Stateful vs Stateless Workflows — When to Use Which
Azure Logic Apps (Standard) offers two workflow types: stateful and stateless. Choosing the right type impacts performance, cost, and observability. This tutorial explains the differences and helps you decide which to use.
What Is a Stateful Workflow?
A stateful workflow persists its run history and state to external storage (Azure Storage) at each action. This enables:
- Run history — Full visibility into past executions, inputs, and outputs
- Long-running operations — Supports workflows that run for hours, days, or longer
- Durable execution — Survives host restarts; resumes from the last checkpoint
- Resubmit capability — Re-run failed actions from the run history

What Is a Stateless Workflow?
A stateless workflow runs entirely in memory without persisting run history. This provides:
- Faster execution — No storage I/O overhead between actions
- Lower latency — Ideal for synchronous request-response patterns
- Reduced cost — No storage transactions for run state
- No run history — Once complete, execution details are gone (unless you enable Application Insights)

Comparison Table
| Feature | Stateful | Stateless |
|---|---|---|
| Run history | ✅ Persisted to storage | ❌ Not available |
| Performance | Slower (storage I/O per action) | Faster (in-memory only) |
| Durability | Survives restarts | Lost on restart |
| Debugging | Full input/output visibility | Requires Application Insights |
| Cost | Higher (storage transactions) | Lower (no storage overhead) |
| Long-running support | ✅ Yes | ❌ No |
| Max duration | Days/weeks | Request timeout (~230 sec) |
When to Use Stateful
Choose stateful workflows when you need:
- Business-critical workflows — Order processing, approvals, orchestrations
- Debugging and auditing — Run history for troubleshooting and compliance
- Long-running processes — Waiting for human approval or external callbacks
- Retry and resubmit — Ability to replay failed runs from a specific action
- Batching and chunking — Processing large datasets over time
When to Use Stateless
Choose stateless workflows when you need:
- High-throughput processing — Event-driven microservices handling thousands of requests/sec
- Request-response APIs — Synchronous endpoints where latency matters
- Low-latency transformations — Data mapping, validation, routing
- Cost optimization — High-volume scenarios where storage costs add up
- Simple integrations — Fire-and-forget or lightweight orchestrations
Step-by-Step: Create Both Types and Compare Behavior
Step 1: Create a Stateful Workflow
- Open your Logic App (Standard) in the Azure Portal
- Navigate to Workflows → + Add
- Enter a name:
order-processing-stateful - Select State type: Stateful
- Click Create

Step 2: Create a Stateless Workflow
- Navigate to Workflows → + Add
- Enter a name:
order-validation-stateless - Select State type: Stateless
- Click Create

Step 3: Add Identical Logic to Both
Add the same actions to both workflows for comparison:
- Trigger: When an HTTP request is received
- Action 1: Compose — transform the input payload
- Action 2: Compose — add a timestamp
- Action 3: Response — return the result
Step 4: Test and Compare
Trigger both workflows with the same HTTP request and observe:
- Stateful: Run appears in run history with full input/output per action
- Stateless: No run history; response returns noticeably faster

Performance Benchmarks
Approximate latency differences for a 3-action HTTP-triggered workflow:
| Metric | Stateful | Stateless | Difference |
|---|---|---|---|
| Cold start | ~800 ms | ~400 ms | ~2x faster |
| Warm execution | ~300–500 ms | ~50–150 ms | ~3–5x faster |
| Throughput (req/sec) | ~50–100 | ~200–500 | ~4x higher |
| Storage transactions/run | 6–10 | 0 | 100% reduction |
Note: These are approximate values. Actual performance depends on action complexity, connector types, and hosting plan (WS1/WS2/WS3).
Converting Between Stateful and Stateless
You cannot change the state type of an existing workflow in-place. To convert:
Stateful → Stateless
- Open the stateful workflow in the Designer
- Select Code view and copy the
workflow.jsondefinition - Create a new stateless workflow
- Paste the definition into the new workflow's code view
- Remove any actions that require run history (e.g., resubmit patterns)
- Save and test
Stateless → Stateful
- Open the stateless workflow in Code view
- Copy the
workflow.jsondefinition - Create a new stateful workflow
- Paste the definition and save
- Run history will now be available for future executions

Via host.json (Enable Run History for Stateless — Preview)
You can temporarily enable run history on stateless workflows for debugging:
{
"extensions": {
"workflow": {
"settings": {
"Runtime.FlowRunRetryableActionJobCallback.StatelessRunHistory": "true"
}
}
}
}
Warning: This adds storage overhead and should only be used for debugging, not production.
Summary
| Scenario | Recommended Type |
|---|---|
| Order processing pipeline | Stateful |
| API gateway / routing | Stateless |
| Human approval workflow | Stateful |
| Data validation endpoint | Stateless |
| Scheduled batch job | Stateful |
| Event-driven microservice | Stateless |
Choose stateful when you need visibility and durability. Choose stateless when you need speed and throughput.
← Previous: Calling APIs from Workflows | Next: CI/CD for Logic Apps →