Inputs / Outputs
Learn how to use different inputs and outputs in your workflows.
Inputs and outputs are the way to communicate between steps in a workflow. In the previous example,
we used StartEvent
and StopEvent
to communicate between steps. However, you can use any type of event to communicate between steps.
Multiple inputs
You can define multiple inputs for a step.
In the following example, we define a complex workflow with multiple inputs and outputs.
First, let's define the events that we will use in the workflow.
This step means that it requires two events: AEvent
and BEvent
. It will return a ResultEvent
with the data A: ${a}, B: ${b}
.
A or B input
If we want to have a step that can accept either AEvent
or BEvent
, we can define the step like this:
This step means that it requires either AEvent
or BEvent
. It will return a ResultEvent
with the data A: ${a}
or B: ${b}
.
You can still combine the logic with context.requireEvent
to get the data from the event.
Multiple outputs
You can define multiple outputs for a step.
This step will return either an AEvent
or a BEvent
based on a random number.
Last updated on