Skip to main content

Script tasks

A script task is used to model the evaluation of a script; for example, a script written in Groovy, JavaScript, or Python.


Script 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 script 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 script tasks are not processed by Zeebe itself. To process them, provide a job worker.

Defining a task

A script task must define a job type the same way as a service task does. It specifies the type of job workers should subscribe to (e.g. script).

Use task headers to pass static parameters to the job worker (e.g. the script to evaluate). The community extension Zeebe Script Worker requires certain attributes to be set in the task headers.

Define variable mappings the same way as a service task does to transform the variables passed to the job worker, or to customize how the variables of the job merge.

Additional resources

Community Extension

Review the Zeebe Script Worker. This is a community extension that provides a job worker to evaluate scripts. You can run it, or use it as a blueprint for your own job worker.

XML representation

A script task with a custom header:

<bpmn:scriptTask id="calculate-sum" name="Calculate sum">
<zeebe:taskDefinition type="script" />
<zeebe:header key="language" value="javascript" />
<zeebe:header key="script" value="a + b" />