Update workflow
PUT/workflows/{id}
Updates an existing workflow and automatically creates a new version snapshot. If the workflow status is 'active', the new version is published immediately. All conditions and actions can be replaced by providing new JSON arrays.
Request
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | Integer ID of the workflow to update. Example: |
Request body
Content type application/json (required).
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Updated workflow name. Max length: 180 |
description | string, nullable | No | Updated description. Max length: 2000 |
trigger | string | Yes | Updated trigger event name. Max length: 120 |
throttle_per_minute | integer | No | Updated throttle limit per minute. Minimum: 0 · Maximum: 100000 |
error_policy | string | No | Updated error handling policy. One of: |
status | string | No | Updated lifecycle status. One of: |
conditions_json | string | No | Replacement conditions JSON array (omit to keep existing). |
actions_json | string | No | Replacement actions JSON array (omit to keep existing). |
Example
{
"name": "New Lead Welcome Email",
"trigger": "crm.lead.created",
"throttle_per_minute": 200,
"error_policy": "retry",
"status": "active",
"actions_json": "[{\"type\":\"send_email\",\"config\":{\"template\":\"lead_welcome_v2\",\"to\":\"{{lead.email}}\"}},{\"type\":\"assign_owner\",\"config\":{\"user_id\":5}}]"
}
Responses
302 Redirect to workflows list after update
404 Workflow not found
422 Validation error
Example request
curl -X PUT "https://{tenant}.faciotech.net/api/v1/workflows/{id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"name": "New Lead Welcome Email", "trigger": "crm.lead.created", "throttle_per_minute": 200, "error_policy": "retry", "status": "active", "actions_json": "[{\"type\":\"send_email\",\"config\":{\"template\":\"lead_welcome_v2\",\"to\":\"{{lead.email}}\"}},{\"type\":\"assign_owner\",\"config\":{\"user_id\":5}}]"}'