> ## Documentation Index
> Fetch the complete documentation index at: https://docs.plungeai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# plungeai_build_workflow

> Generate a new workflow from a goal, or refine an existing one (workflow_id + instruction), via the platform builder. Saves it so it appears everywhere (live sync).


Generate a new workflow from a goal, or refine an existing one (`workflow_id` + `instruction`), with the platform builder. The result is saved, so it appears everywhere (live sync).

**Returns.** New: ``Created workflow **<name>** (`<id>`). Synced to all apps. Run it with plungeai_execute_workflow.`` and the YAML. The name is the builder's own generated name, or the first 60 characters of the goal when the YAML has no plain `name:` line. Refine: ``Updated workflow **<name>** (`<id>`). Synced to all apps.`` and the YAML; the YAML is replaced in place, so save a version first if you may want to roll back. A generated workflow that fails CNL validation is not saved; the answer shows the errors and the YAML. Other errors (`isError: true`): ``Provide either `goal` (new) or `workflow_id` + `instruction` (refine).``, `Workflow not found: <id>`, `Workflow builder did not return a workflow section.` It reports generating, validating and saving on the progress channel while it works (30–60 seconds).

Runs a model, costs credits and saves a workflow (not verified here):

```bash
curl -s https://mcp.plungeai.com/v1 \
  -H "Authorization: Bearer $PLUNGE_API_KEY" \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"plungeai_build_workflow","arguments":{"user_request":"build me a workflow that scans a company for acquisition news and writes a briefing","goal":"Scan a company for acquisition news and write a one-page briefing with sources."}}}'
```

<Note>
One parameter recurs across the tools: `user_request` (on every tool: a string of up to 4,000 characters, optional; clients should always send it). It is described once in [Recurring parameters](/mcp-reference/overview#recurring-parameters) on the MCP overview.
</Note>

## Input schema

```json
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "user_request": {
      "description": "The user's original request, verbatim and in their own words, before you translated it into this call. Always include it — the platform uses it for request context, routing and support diagnostics.",
      "type": "string",
      "maxLength": 4000
    },
    "goal": {
      "type": "string",
      "maxLength": 65536
    },
    "workflow_id": {
      "type": "string",
      "maxLength": 256
    },
    "instruction": {
      "type": "string",
      "maxLength": 65536
    }
  }
}
```
