Skip to main content

Signal Running Task Synchronously

Endpoint: POST /api/tasks/{workflowId}/{status}/signal/sync

Signals a running Yield task in the specified workflow synchronously with a new status and output. The request blocks execution until the signal is processed and returns the updated workflow state, based on the returnStrategy. This API is useful for tightly coordinated task control or integrating external events into an ongoing workflow.

Path parameters

ParameterDescriptionTypeRequired/ Optional
workflowIdThe execution ID of the workflow containing the Yield task.stringRequired.
statusThe status to which the task is to be updated. Supported values:
  • IN_PROGRESS
  • FAILED
  • FAILED_WITH_TERMINAL_ERROR
  • COMPLETED
stringRequired.

Query parameters

ParameterDescriptionTypeRequired/ Optional
returnStrategyThe strategy that determines what response the API returns. Supported values:
  • TARGET_WORKFLOW–Returns the full execution state of the originally triggered workflow. Use this when monitoring the overall workflow status or managing orchestration at the top level.
  • BLOCKING_WORKFLOW–Returns the state of the workflow that is currently blocking the original workflow execution. This may be a sub workflow. Use when signaling Yield tasks in nested workflows.
  • BLOCKING_TASK–Returns the execution status of the task that is currently blocking workflow execution. Best for real-time status checks.
  • BLOCKING_TASK_INPUT–Returns the input payload of the task that is currently blocking workflow execution. Ideal for debugging or runtime inspection.
The default is TARGET_WORKFLOW.
stringOptional.

Request body

Format the request to include any additional parameters, such as task output.

Example

{
"additionalProp1": {},
"additionalProp2": {},
"additionalProp3": {}
}

Response

Returns 200 OK, indicating that the task status was successfully updated and the signal was processed. The response payload structure depends on the returnStrategy specified in the request.

Examples

Signal a running task synchronously with TARGET_WORKFLOW as return strategy

Request

curl -X 'POST' \
'https://<YOUR-CLUSTER>/api/tasks/ea866cbb-29ab-11f0-8259-1a170f75b9fc/FAILED_WITH_TERMINAL_ERROR/signal/sync?returnStrategy=TARGET_WORKFLOW' \
-H 'accept: application/json' \
-H 'X-Authorization: <TOKEN>' \
-d '{
"additionalProp1": {}
}'

Response

Returns a 200 OK response indicating that the task status was updated successfully and the signal was processed. The response includes the current state of the workflow, as specified by the returnStrategy TARGET_WORKFLOW.

//truncated response
{
"responseType": "TARGET_WORKFLOW",
"targetWorkflowId": "fd7s71db5e9c-4a9e-11f0-8f25-26000e13d725",
"targetWorkflowStatus": "RUNNING",
"workflowId": "fd7s71db5e9c-4a9e-11f0-8f25-26000e13d725",
"tasks": [
{
"taskType": "YIELD",
"status": "COMPLETED",
"inputData": {
"_createdBy": "john.doe@acme.com"
},
"referenceTaskName": "yield_ref",
"retryCount": 0,
"seq": 1,
"pollCount": 0,
"taskDefName": "yield",
"scheduledTime": 1750070520205,
"startTime": 0,
"endTime": 1750070632655,
"updateTime": 1750070632656,
"startDelayInSeconds": 0,
"retried": false,
"executed": true,
"callbackFromWorker": true,
"responseTimeoutSeconds": 0,
"workflowInstanceId": "fd7s71db5e9c-4a9e-11f0-8f25-26000e13d725",
"workflowType": "sample-yield-task",
"taskId": "fd7s88646e5a-4a9e-11f0-a337-9e736287a215",
"callbackAfterSeconds": 0,
"workerId": "10.0.8.137",
"outputData": {
"additionalProp1": {}
},
Signal a running task synchronously with BLOCKING_WORKFLOW as return strategy

Request

curl -X 'POST' \
'https://<YOUR-CLUSTER>/api/tasks/fd7s71db5e9c-4a9e-11f0-8f25-26000e13d725/COMPLETED/signal/sync?returnStrategy=BLOCKING_WORKFLOW' \
-H 'accept: application/json' \
-H 'X-Authorization: <TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"additionalProp1": {}
}'

Response

Returns a 200 OK response indicating that the task status was updated successfully and the signal was processed. The response includes the current state of the blocking workflow, which is a sub workflow.

// truncated response
{
"responseType": "BLOCKING_WORKFLOW",
"targetWorkflowId": "fd7s71db5e9c-4a9e-11f0-8f25-26000e13d725",
"targetWorkflowStatus": "RUNNING",
"workflowId": "fd7s71db5e9c-4a9e-11f0-8f25-26000e13d725",
"input": {},
"output": {},
"priority": 0,
"variables": {},
"tasks": [
{
"taskType": "YIELD",
"status": "COMPLETED",
"inputData": {
"_createdBy": "john.doe@acme.com"
},
.
.
.
{
"taskType": "SUB_WORKFLOW",
"status": "IN_PROGRESS",
"inputData": {
"subWorkflowDefinition": null,
"workflowInput": {},
"subWorkflowTaskToDomain": null,
"subWorkflowName": "demo-feb",
"subWorkflowPriority": null,
"_createdBy": "john.doe@acme.com",
"subWorkflowVersion": 1
},
"referenceTaskName": "sub_workflow_ref",
"createTime": 1750070482397,
"status": "RUNNING",
"updateTime": 1750070926333
}
Signal a running task synchronously with BLOCKING_TASK as return strategy

Request

curl -X 'POST' \
'https:<YOUR-CLUSTER>/api/tasks/fd7s71db5e9c-4a9e-11f0-8f25-26000e13d725/COMPLETED/signal/sync?returnStrategy=BLOCKING_TASK' \
-H 'accept: application/json' \
-H 'X-Authorization: <TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"additionalProp1": {}
}'

Response

Returns a 200 OK response indicating that the task status was updated successfully and the signal was processed. The response includes the execution state of the task that is currently blocking progress.

// truncated response
{
"responseType": "BLOCKING_TASK",
"targetWorkflowId": "fd7s71db5e9c-4a9e-11f0-8f25-26000e13d725",
"targetWorkflowStatus": "RUNNING",
"workflowId": "fd7s71db5e9c-4a9e-11f0-8f25-26000e13d725",
"input": {
"subWorkflowDefinition": null,
"workflowInput": {},
"subWorkflowTaskToDomain": null,
"subWorkflowName": "demo-feb",
"subWorkflowPriority": null,
"_createdBy": "john.doe@acme.com",
"subWorkflowVersion": 1
},
"output": {
"subWorkflowId": "fd7sea8f8c0f-4a9f-11f0-a337-9e736287a215"
},
"taskType": "SUB_WORKFLOW",
"taskId": "fd7sea8e538e-4a9f-11f0-a337-9e736287a215",
"referenceTaskName": "sub_workflow_ref",
"retryCount": 0,
"taskDefName": "sub_workflow",
"workflowType": "sample-yield-task",
"priority": 0,
"createTime": 1750071114395,
"updateTime": 1750071114408,
"status": "IN_PROGRESS"
}
Signal a running task synchronously with BLOCKING_TASK_INPUT as return strategy

Request

curl -X 'POST' \
'https://<YOUR-CLUSTER>/api/tasks/fd7s71db5e9c-4a9e-11f0-8f25-26000e13d725/COMPLETED/signal/sync?returnStrategy=BLOCKING_TASK_INPUT' \
-H 'accept: application/json' \
-H 'X-Authorization: <YOUR-TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"additionalProp1": {}
}'

Response

Returns a 200 OK response indicating that the task status was updated successfully and the signal was processed. The response includes the input payload of the task that is currently blocking workflow progress.

//truncated response
{
"responseType": "BLOCKING_TASK_INPUT",
"targetWorkflowId": "fd7s71db5e9c-4a9e-11f0-8f25-26000e13d725",
"targetWorkflowStatus": "RUNNING",
"workflowId": "fd7s71db5e9c-4a9e-11f0-8f25-26000e13d725",
"input": {
"subWorkflowDefinition": null,
"workflowInput": {},
"subWorkflowTaskToDomain": null,
"subWorkflowName": "demo-feb",
"subWorkflowPriority": null,
"_createdBy": "john.doe@acme.com",
"subWorkflowVersion": 1
},
"output": {
"subWorkflowId": "fd7s86925c46-4aa0-11f0-a337-9e736287a215"
},
"taskType": "SUB_WORKFLOW",
"taskId": "fd7s869123c5-4aa0-11f0-a337-9e736287a215",
"referenceTaskName": "sub_workflow_ref",
"retryCount": 0,
"taskDefName": "sub_workflow",
"workflowType": "sample-yield-task",
"priority": 0,
"createTime": 1750071376139,
"updateTime": 1750071376151,
"status": "IN_PROGRESS"
}