Documentation / Conception / Guides pratiques / Simulate a workflow

Simulate a workflow

Simulation runs the current graph — even unsaved — against a forged event, through the same interpreter as production, but with no durability and no side effects. Use it to check a workflow's logic before you save or run it.

In the editor

Press ▶ Simulate in the workflow editor. Choose the event and the scenario, then read the result overlaid on the graph.

What the sandboxes do (each port's sandbox is contributed by the plugin that owns the port):

  • Seeded reads — each port reads from its seed: an inline snapshot you supply per port, or, for a record port, the live record of a real subject (via the record service, in-memory or FHIR depending on the instance).
  • Captured writesaddObservation / addCondition / addNotification … are listed as "what would have been written" but never applied. The sandbox does read back its own writes, so read-after-write within a run stays consistent.
  • Scenario-driven validations — each human-validation node is decided per the chosen scenario (accepted / rejected / timed-out). This is how you exercise the escalation branch without waiting for an SLA.
  • Simulated agents — a deterministic example output of the declared type, with no LLM call, unless you tick "real agents".

The result appears as an overlay on the graph (✓ ran / ⤼ skipped, with the reason and the inputs/outputs on hover). The side panel lists the captured writes, the validations presented, and the trace.

Via the API

POST /api/simulate
{
  "spec": { … } ,            // or "file": "my-workflow.workflow.yaml"
  "event": { … },
  "options": {
    "seeds": {                // one opaque seed per port name (shape defined by
      "patient": { … },       // the owning plugin's sandbox — e.g. a partial
      "prescription": [ … ]   // PatientProfile, a prescription list…)
    },
    "subject": { "kind": "patient", "id": "…" },  // or: read a REAL record as the
                                                  // seed of that kind's record port
    "validations": { "node-id": "accepted" | "rejected" | "timeout" },
    "agent": "mock" | "real"
  }
}

The response is a report: { status, nodes, effects, validations, logs, durationMs }, where nodes are the per-node observations, effects the captured writes, and logs the engine's structured trace. A port whose plugin contributes no sandbox is absent in simulation: a node that needs it fails with Port « … » non branché, visible in the report.

Next

75 documents3 sectionssource : /docs · généré au build