---
description: "Event Task — publish events to message brokers (Kafka, SQS, NATS) from Conductor workflows for event-driven orchestration."
---
# Event Task

```json
"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 (RabbitMQ)
- Kafka
- NATS
- NATS Streaming
- SQS

For details on configuring connections to these event buses (Kafka bootstrap servers, NATS URLs, AMQP credentials, etc.), see the [Event Bus Orchestration](../../../../devguide/how-tos/event-bus.md#configuration) guide.


## 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: <ul><li>`conductor`</li> <li>`ampq`, `amqp_queue`, or `amqp_exchange`</li> <li>`kafka`</li> <li>`nats`</li> <li>`nats-stream`</li> <li>`sqs`</li></ul> <br/> **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](#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. <ul><li>**false**—Task status is set to COMPLETED upon successful execution.</li> <li>**true**—Task status is kept as IN_PROGRESS until an external event marks it as complete.</li></ul> | 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.

```json
{
  "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.

``` json
{
  "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:

``` json
{
  "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"
}
```