> ## Documentation Index
> Fetch the complete documentation index at: https://docs.devset.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Safely Simulate Workflow Execution in the Playground

> Use the Devset Playground to simulate workflow pipelines and preview emitted payloads without dispatching any real messages to a broker.

The Playground lets you simulate the execution of any workflow without sending a single message to Kafka or RabbitMQ. Devset runs the pipeline logic locally and shows you exactly what each stage would emit — headers, payload, and all — so you can validate your DSL, test expression logic, and preview payloads before pointing a workflow at a live broker. Open the Playground at [http://localhost:8082/playground](http://localhost:8082/playground).

## Running a Simulation

<Steps>
  <Step title="Choose your source">
    At the top of the Playground, select how you want to provide the workflow to simulate:

    * **Saved workflow** — open the dropdown and pick any workflow from your saved list in the Flow Builder.
    * **Raw DSL JSON** — paste a raw workflow DSL JSON object directly into the text area. This is useful for testing a workflow that you have not saved yet, or for simulating a DSL received from a teammate.
  </Step>

  <Step title="Click Preview">
    Click the **Preview** button. Devset sends the workflow DSL to the backend simulate endpoint, which runs the full pipeline logic without connecting to any broker.
  </Step>

  <Step title="Inspect the results">
    The **results panel** renders below the source selector with a stage strip and event log showing the full simulation output.
  </Step>
</Steps>

## Reading the Results Panel

The results panel is the core of the Playground experience. It organises simulation output by pipeline stage.

<Steps>
  <Step title="Browse the stage strip">
    A horizontal **stage strip** at the top of the panel shows every pipeline stage in order. Each stage is represented as a pill labelled with its stage name and index. A **Result** pill at the end represents the final accumulated output.
  </Step>

  <Step title="Inspect a stage's emitted event">
    Click a stage pill to filter the event log to the events produced by that stage. Select any event in the log to see its full details:

    * **Headers** — the message headers computed for that stage.
    * **Payload** — the message body, rendered as formatted JSON.

    Review these details to confirm that your field expressions, state references, and conditional logic are producing the values you expect.
  </Step>
</Steps>

<Note>
  **Wait stages are skipped** in Playground simulation. Because the simulator does not run against real time or a live broker, any stage configured with a wait/delay is executed immediately with a zero-duration wait. Keep this in mind when interpreting simulation results for workflows that use timing-dependent logic.
</Note>

## Playground vs. Workflow Runs

The Playground and [Workflow Runs](/guides/workflow-runs) both execute your pipeline, but they serve different purposes:

|                                 | Playground                      | Workflow Runs                 |
| ------------------------------- | ------------------------------- | ----------------------------- |
| **Sends real messages**         | No                              | Yes                           |
| **Requires a broker connector** | No                              | Yes                           |
| **Shows emitted payloads**      | Yes                             | Yes                           |
| **Wait stages honoured**        | No (skipped)                    | Yes                           |
| **Use when**                    | Developing and validating logic | Testing against a live broker |

## When to Use the Playground

<CardGroup cols={2}>
  <Card title="Test DSL Logic" icon="code">
    Paste or load a workflow and immediately see whether your stage configurations and state transformations produce the right output.
  </Card>

  <Card title="Validate Expressions" icon="function">
    Check that Function Studio expressions — `FN` calls like `uuid()`, `REF` lookups, `WHEN` conditionals — resolve to the expected values before running against a real broker.
  </Card>

  <Card title="Preview Payloads" icon="eye">
    Confirm the exact JSON shape of every emitted message before sending it to downstream consumers. Catch missing fields and type mismatches early.
  </Card>

  <Card title="Iterate Quickly" icon="rotate">
    Because no broker connection is required, you can paste a revised DSL and click Preview as many times as you need without any external side effects.
  </Card>
</CardGroup>

<Tip>
  When you are ready to move from simulation to live testing, copy the DSL from the source field, import it into the Flow Builder using the **Import** button in the Manage view, and then create a Workflow Run against your connector.
</Tip>
