> For the complete documentation index, see [llms.txt](https://docs.nected.ai/nected-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nected.ai/nected-docs/management-api/workflow/update-workflow.md).

# Update Workflow

Update an existing workflow by entity ID. The request body must be the **full workflow graph** — the server replaces the entire stored graph, so partial field updates are not supported.

The `checksum` from the last **Get workflow by id**, **Create**, or **Update** response is required. If it does not match the server's current checksum, the update is rejected.

On success, the response returns a new `data.checksum` — store it before calling test or publish.

## Update workflow

> Update an existing workflow by entity ID.\
> \
> \*\*Send the full workflow graph\*\* — the server replaces the entire stored graph. Partial field updates are not supported.\
> \
> \*\*Recommended flow:\*\*\
> 1\. \`GET /dev/v1/workflow/{entity-id}\` → copy \`data\` and \`data.checksum\`\
> 2\. Modify the fields you need\
> 3\. PATCH with the full modified document + \`checksum\` from step 1\
> \
> \*\*\`checksum\` is required.\*\* If it does not match the server's current checksum the update is rejected.\
> \
> \*\*On success:\*\* response returns a new \`data.checksum\` — store it before calling test or publish.\
> \
> \*\*Canonical request body:\*\* \`Update/update\_workflow\.json\`

```json
{"openapi":"3.0.3","info":{"title":"Nected Workflow API (Dev V1)","version":"1.0"},"tags":[{"name":"Workflow","description":"List, create, read, update, test, and publish workflows."}],"servers":[{"url":"https://api.nected.ai","description":"Production"}],"security":[{"DevAuth":[]}],"components":{"securitySchemes":{"DevAuth":{"type":"apiKey","in":"header","name":"Nected-API-Key","description":"Your Nected API key. Obtain from your workspace settings."}},"schemas":{"UpdateWorkflowPayload":{"type":"object","description":"Request body for Update workflow. Send the **full** workflow graph (same shape as Create) plus `checksum`.\n\nDo **not** send partial field updates — the server replaces the full graph. Recommended: get the current document, modify it, send it back with the current `checksum`.\n\nCanonical file: `Update/update_workflow.json`.","additionalProperties":true,"properties":{"checksum":{"type":"string","description":"Current checksum from the last get/create/update — required for optimistic locking"},"name":{"type":"string"},"description":{"type":"string"},"startNode":{"type":"string"},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowNode"}},"edges":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowEdge"}},"trigger":{"type":"object"},"comment":{"type":"string"},"isEnabled":{"type":"boolean"},"settings":{"$ref":"#/components/schemas/WorkflowSettings"},"dependencyMap":{"type":"array","items":{}}}},"WorkflowNode":{"type":"object","description":"A node in the workflow graph. The `type` field determines what `data.nodeType` can be:\n- `trigger` — the API entry point (`nodeType: apiTrigger`). Always `id: \"1\"`.\n- `codeNode` — runs an inline code snippet (`nodeType: codeNode`).\n- `addNode` — UI placeholder node for connecting segments (`nodeType: addNodeMd`).\n- Other types: `ruleNode`, `connectorNode`, `responseNode`, `setVariableNode`, etc.","additionalProperties":true,"properties":{"id":{"type":"string","description":"Unique node ID within this workflow"},"type":{"type":"string","description":"Node type (trigger, codeNode, addNode, ruleNode, etc.)"},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}}},"style":{"nullable":true},"sourcePosition":{"type":"string","enum":["bottom","right"]},"targetPosition":{"type":"string","enum":["top","left"]},"draggable":{"type":"boolean"},"data":{"$ref":"#/components/schemas/WorkflowNodeData"}}},"WorkflowNodeData":{"type":"object","description":"Node-specific data. Shape varies by `nodeType`.","additionalProperties":true,"properties":{"nodeType":{"type":"string","description":"e.g. apiTrigger, codeNode, addNodeMd, ruleNode, connectorNode"},"name":{"type":"string","description":"Display name of the node"},"entity":{"type":"string"},"entityId":{"type":"string"},"pluginName":{"type":"string"},"status":{"type":"string","description":"Last execution status (success, error, etc.)"},"rootId":{"type":"string"},"sourceIds":{"nullable":true},"isMergeNode":{"type":"boolean"},"switcher":{"nullable":true},"conditions":{"nullable":true},"blockName":{"type":"string"},"input":{"type":"object","nullable":true,"description":"Input parameter definitions keyed by field name","additionalProperties":{"$ref":"#/components/schemas/NodeInputField"}},"output":{"nullable":true},"settings":{"type":"object","nullable":true,"description":"Node-level settings (varies by nodeType)"},"executedValue":{"description":"Last execution output (populated after test run)","nullable":true},"runInLoop":{"$ref":"#/components/schemas/RunInLoop"}}},"NodeInputField":{"type":"object","description":"Definition of a single input field on a node","additionalProperties":true,"properties":{"name":{"type":"string"},"dataType":{"type":"string","description":"e.g. string, numeric, boolean, json, list"},"executedValue":{"description":"Value used during the last test execution"},"isCaseSensitive":{"type":"boolean"},"isNullable":{"type":"boolean"},"isOptional":{"type":"boolean"},"keyAttribute":{"type":"string"},"keySource":{"type":"string"},"mapping":{"type":"boolean"},"notSend":{"type":"boolean"},"order":{"type":"integer"},"schemaId":{"type":"string"},"sendNull":{"type":"boolean"},"source":{"type":"string"},"attribute":{"type":"string"},"value":{"description":"Static value or expression; null when sourced dynamically"}}},"RunInLoop":{"type":"object","description":"Loop configuration for iterating over a list","properties":{"status":{"type":"boolean","description":"Whether this node runs in a loop"},"source":{"type":"string"},"attribute":{"type":"string"},"value":{"nullable":true}}},"WorkflowEdge":{"type":"object","description":"A directed connection between two nodes","properties":{"id":{"type":"string"},"source":{"type":"string","description":"ID of the source node"},"target":{"type":"string","description":"ID of the target node"},"type":{"type":"string"},"animated":{"type":"boolean"},"label":{"type":"string"},"markerEnd":{"type":"string"},"sourceHandle":{"type":"string"},"style":{"type":"object","properties":{"stroke":{"type":"string"},"strokeWidth":{"type":"number"}}},"data":{"type":"object","properties":{"edgeType":{"type":"string","description":"e.g. `then`, `else`"},"pathId":{"type":"string"}}}}},"WorkflowSettings":{"type":"object","description":"Runtime settings for the workflow","properties":{"auditIO":{"type":"boolean","description":"Whether to record input/output for audit logs"},"dateFormat":{"type":"string","description":"Date format locale (e.g. `in` for India)"},"timezone":{"type":"string","description":"IANA timezone string (e.g. `Asia/Kolkata`)"}}},"UpdateWorkflowResponse":{"type":"object","description":"Success response for PATCH /dev/v1/workflow/{entity-id}","properties":{"data":{"type":"object","properties":{"checksum":{"type":"string","description":"New checksum — store for next update, test, or publish call"}}},"code":{"type":"string"},"message":{"type":"string"}}},"ErrorResponse":{"type":"object","description":"Error response wrapper","properties":{"code":{"type":"string"},"message":{"type":"string","description":"Human-readable error message"},"data":{"nullable":true}}}}},"paths":{"/dev/v1/workflow/{entity-id}":{"patch":{"operationId":"updateWorkflow","tags":["Workflow"],"summary":"Update workflow","description":"Update an existing workflow by entity ID.\n\n**Send the full workflow graph** — the server replaces the entire stored graph. Partial field updates are not supported.\n\n**Recommended flow:**\n1. `GET /dev/v1/workflow/{entity-id}` → copy `data` and `data.checksum`\n2. Modify the fields you need\n3. PATCH with the full modified document + `checksum` from step 1\n\n**`checksum` is required.** If it does not match the server's current checksum the update is rejected.\n\n**On success:** response returns a new `data.checksum` — store it before calling test or publish.\n\n**Canonical request body:** `Update/update_workflow.json`","parameters":[{"name":"Nected-Branch","in":"header","required":false,"description":"Branch name (optional)","schema":{"type":"string"}},{"name":"entity-id","in":"path","required":true,"description":"The workflow entity ID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWorkflowPayload"}}}},"responses":{"200":{"description":"OK — returns new `data.checksum`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWorkflowResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

### Request body

{% file src="/files/mWRrbs0yoCPWVGHTS22R" %}
