Skip to content

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

NameTypeRequiredDescription
idintegerYes

Integer ID of the workflow to update.

Example: 8

Request body

Content type application/json (required).

FieldTypeRequiredDescription
namestringYes

Updated workflow name.

Max length: 180

descriptionstring, nullableNo

Updated description.

Max length: 2000

triggerstringYes

Updated trigger event name.

Max length: 120

throttle_per_minuteintegerNo

Updated throttle limit per minute.

Minimum: 0 · Maximum: 100000

error_policystringNo

Updated error handling policy.

One of: "retry", "halt", "dlq"

statusstringNo

Updated lifecycle status.

One of: "draft", "active", "archived"

conditions_jsonstringNo

Replacement conditions JSON array (omit to keep existing).

actions_jsonstringNo

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}}]"}'
Loading