Update workflow
/workflow/{id}
Updates a workflow's trigger or config. The body can be JSON or YAML. A config sent replaces the stored one.
Path Parameters
Request Body
Workflow execution configuration.
JSONata condition evaluated before executing workflow steps.
integration.name = 'calcom'5 properties
Action executed by the step. run_sync_job is the only action.
run_sync_jobrun_sync_job
A JSONata expression that returns the step's payload, or an object whose values may use {{placeholders}}. For run_sync_job it must give a sync_job_id.
(
$sync_job_id := $mapValues(integration.name,{
"calcom": "51b79ace-a7b4-4077-93ba-8048a06ece2b"
});
{
"sync_job_id": $sync_job_id,
"integrated_account_id": integrated_account_id,
"webhook_id": "9fda519d-148f-4cc5-bbac-4e373b16e5d4"
}
)
Optional cron expression for scheduled execution, in UTC. When set, the step creates a sync job cron trigger instead of starting a run, so the trigger's check applies: the step fails if the expression doesn't parse or its next two runs are less than 5 minutes apart.
0 */6 * * *JSONata condition; the step is skipped when it is falsy.
Step execution type.
runrun
Why this change is being made. Optional, at most 2000 characters, recorded with the version this save creates (see GET /workflow/{id}/versions). Not saved on the workflow.
The event that runs the workflow. integrated_account:active runs when an integrated account becomes active (for example right after it is connected); unified_webhook:batch runs when a batch of unified webhook events arrives.
integrated_account:activeintegrated_account:activeunified_webhook:batch
Response Body
Workflow execution configuration.
JSONata condition evaluated before executing workflow steps.
integration.name = 'calcom'5 properties
Action executed by the step. run_sync_job is the only action.
run_sync_jobrun_sync_job
A JSONata expression that returns the step's payload, or an object whose values may use {{placeholders}}. For run_sync_job it must give a sync_job_id.
(
$sync_job_id := $mapValues(integration.name,{
"calcom": "51b79ace-a7b4-4077-93ba-8048a06ece2b"
});
{
"sync_job_id": $sync_job_id,
"integrated_account_id": integrated_account_id,
"webhook_id": "9fda519d-148f-4cc5-bbac-4e373b16e5d4"
}
)
Optional cron expression for scheduled execution, in UTC. When set, the step creates a sync job cron trigger instead of starting a run, so the trigger's check applies: the step fails if the expression doesn't parse or its next two runs are less than 5 minutes apart.
0 */6 * * *JSONata condition; the step is skipped when it is falsy.
Step execution type.
runrun
When the workflow was created.
The environment the workflow belongs to.
05daecaf-4365-42e8-8370-8127de5dd717The ID of the workflow.
4a4de828-f4db-4c9e-adfd-434e0864c3c7The event that runs the workflow. integrated_account:active runs when an integrated account becomes active (for example right after it is connected); unified_webhook:batch runs when a batch of unified webhook events arrives.
integrated_account:activeintegrated_account:activeunified_webhook:batch
When the workflow was last updated.
Errors
| Status | Description |
|---|---|
400 | The body is not valid JSON or YAML, the config is invalid, or change_message is not a string or is too long. |
404 | Workflow not found |
curl -X PATCH 'https://api.truto.one/workflow/{id}' \
-H 'Authorization: Bearer <your_api_token>' \
-H 'Content-Type: application/json' \
-d '{
"trigger_name": "integrated_account:active",
"config": {},
"change_message": "your_change_message"
}'const body = {
"trigger_name": "integrated_account:active",
"config": {},
"change_message": "your_change_message"
};
const response = await fetch('https://api.truto.one/workflow/{id}', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer <your_api_token>',
'Content-Type': 'application/json',
},
body: JSON.stringify(body),
});
const data = await response.json();
console.log(data);import requests
url = "https://api.truto.one/workflow/{id}"
headers = {
"Authorization": "Bearer <your_api_token>",
"Content-Type": "application/json",
}
params = {
}
payload = {
"trigger_name": "integrated_account:active",
"config": {},
"change_message": "your_change_message"
}
response = requests.patch(url, headers=headers, params=params, json=payload)
print(response.json())