Skip to content

Event Task

"type" : "EVENT"

The Event task (EVENT) is used to publish events to supported eventing systems. It enables event-based dependencies within workflows and tasks, making it possible to trigger external systems as part of the workflow execution.

The following queuing systems are supported:

  • Conductor internal queue
  • AMQP
  • Kafka
  • NATS
  • NATS Streaming
  • SQS

Task parameters

Use these parameters in top level of the Event task configuration.

Parameter Type Description Required / Optional
sink String The target event queue in the format prefix:location, where the prefix denotes the queuing system, and the location represents the specific queue name (e.g., send_email_queue). Supported prefixes:
  • conductor
  • ampq, amqp_queue, or amqp_exchange
  • kafka
  • nats
  • nats-stream
  • sqs

Note: For all queuing systems except the Conductor queue, you should use the queue's name, not the URI in location. The URI will be looked up based on the queue name. Refer to Conductor sink configuration for more details on how to use the Conductor queue.
Required.
inputParameters Map[String, Any]. Any other input parameters for the Event task, which will be published to the queuing system. Optional.
asyncComplete Boolean Whether the task is completed asynchronously. The default value is false.
  • false—Task status is set to COMPLETED upon successful execution.
  • true—Task status is kept as IN_PROGRESS until an external event marks it as complete.
Optional.

Conductor sink configuration

When using Conductor as sink, you have two options to set the sink: * conductor * conductor:<workflow_name>:<queue_name> (same as the event value of the event handler)

If the workflow name and queue name is omitted, it will default to the Event task's workflow name and its own taskReferenceName for the queue name.

Configuration JSON

Here is the task configuration for an Event task.

{
  "name": "event",
  "taskReferenceName": "event_ref",
  "type": "EVENT",
  "inputParameters": {},
  "sink": "sqs:sqs_queue_name",
  "asyncComplete": false
}

Output

The Event task will return the following parameters.

Name Type Description
event_produced String The name of the event produced. When producing an event with Conductor as a sink, the event name will be formatted as
conductor:<workflow_name>:<task_reference_name>.
workflowInstanceId String The workflow execution ID.
workflowType String The workflow name.
workflowVersion Integer The workflow version.
correlationId String The workflow correlation ID.
sink String The sink value.
asyncComplete Boolean The asyncComplete value.
taskToDomain Map[String, String] The Event task's domain mapping, if any.

The published event's payload is identical to the task output, minus event_produced.

Examples

In this example, the Event task sends a message to the Conductor queue.

{
  "name": "event_task",
  "taskReferenceName": "event_0",
  "inputParameters": {
    "mod": "${workflow.input.mod}",
    "oddEven": "${workflow.input.oddEven}",
    "sink": "conductor",
    "asyncComplete": false
  },
  "type": "EVENT",
  "decisionCases": {},
  "defaultCase": [],
  "forkTasks": [],
  "startDelay": 0,
  "joinOn": [],
  "sink": "conductor",
  "optional": false,
  "defaultExclusiveJoinTask": [],
  "asyncComplete": false,
  "loopOver": [],
  "onStateChange": {},
  "permissive": false
}

Here is the Event task output upon execution:

{
  "event_produced": "conductor:test workflow:event_0",
  "mod": "2",
  "oddEven": "5",
  "asyncComplete": false,
  "sink": "conductor",
  "workflowType": "test workflow",
  "correlationId": null,
  "taskToDomain": {},
  "workflowVersion": 1,
  "workflowInstanceId": "b7c1e6d9-4a80-48b6-b901-487afef9d7c1"
}