Full Example
The following workflow publishes fiftyorder-created events to a Kafka topic, accumulating a running total and message count in shared state between each execution.
Top-Level Fields
A unique identifier for this workflow. Used in logs, metrics, and the Playground UI to distinguish one workflow from another. Keep it short and descriptive — for example
"order-flow" or "user-signup-v2".The broker type this workflow targets. Set to
"kafka" for Apache Kafka and "rabbit" for RabbitMQ. This controls which routing fields are relevant (topic for Kafka; exchange and routingKey for RabbitMQ).The payload encoding format. Use
"application/json" for human-readable JSON payloads. Use "application/x-protobuf" for binary Protobuf payloads — when using Protobuf you will also need to configure the wireFormat block on each stage.The name of a configured broker connector to use when dispatching messages. This must match a connector you have registered in your Devset environment.
The Kafka topic to publish messages to. Required when
messageType is "kafka". You can override this per-stage if your workflow publishes to multiple topics.The RabbitMQ exchange to publish messages to. Used only when
messageType is "rabbit".The RabbitMQ routing key attached to every outbound message. Used only when
messageType is "rabbit".The default schema identifier applied to every stage in the pipeline. Individual stages can override this with their own
schemaId field. The schema ID is used for payload validation and, when using Protobuf, for resolving the type descriptor.The number of times Devset runs the entire pipeline from start to finish. Setting this to
50 causes every stage in the pipeline to execute fifty times in order, with workflow state persisting and accumulating across all executions. See Execution Model below for details.The initial mutable state object shared across all stages and all executions. Declare your starting values here — for example counters, accumulators, or lookup results. Stages mutate state via their own
state block using DSL functions.An ordered array of Stage objects. Devset executes stages in the order they appear, passing context from one stage to the next. At least one stage is required.
Execution Model
When you setexecutions to a value greater than 1, Devset runs the entire pipeline array that many times in sequence. Think of one execution as a single “scenario run” — for example, one full order lifecycle.
State declared at the top level persists across executions. This means you can accumulate totals, counts, or other cross-run statistics. In the example above, order.total and order.count grow with every execution because each stage’s state block adds to the running values rather than replacing them.
state.sentCount equals 10.
State is reset to its initial values only when you start a new workflow run. Within a single run, all executions share and mutate the same state object.
Kafka vs RabbitMQ
The top-level routing fields differ depending on yourmessageType.
Kafka workflows use topic to identify the destination:
exchange and routingKey instead:
Related Pages
- Stage Fields — full reference for every field a pipeline stage supports, including
set,state,repeat, andquery. - Functions — complete catalog of built-in
$fnexpressions you can use in stage field values. - Wire Format — Protobuf binary framing configuration for Confluent Schema Registry compatibility.