A send task is used to model the publication of a message to an external system; for example, to a Kafka topic or a mail server.
Send tasks behave exactly like service tasks. Both task types are based on jobs and job workers. The differences between these task types are the visual representation (i.e. the task marker) and the semantics for the model.
When a process instance enters a send task, it creates a corresponding job and waits for its completion. A job worker should request jobs of this job type and process them. When the job is complete, the process instance continues.
Jobs for send tasks are not processed by Zeebe itself. To process them, provide a job worker.
Defining a task
A send task must define a job type the same
way as a service task does. It specifies the type of job that workers should subscribe to (e.g.
Use task headers to pass static parameters to the job worker (e.g. the name of the topic to publish the message to).
Review the Kafka Connect Zeebe. This is a community extension that provides a job worker to publish messages to a Kafka topic. You can run it, or use it as a blueprint for your own job worker.
A script task with a custom header:
<bpmn:sendTask id="publish-message" name="Publish message">
<zeebe:taskDefinition type="kafka" />
<zeebe:header key="kafka-topic" value="payment" />