Multi-Action Flow with OCR
Split OCR extraction and downstream processing into separate Actions so each can be reused, tested, and maintained independently.
When to Use This Pattern
- You want one Action to handle OCR and another to process the extracted text.
- Multiple downstream Actions need the same OCR output (e.g., different validation or extraction pipelines).
- You want to keep Actions focused on a single responsibility.
Overview
Action A Action B
┌───────────────────┐ ┌───────────────────┐
│ OCR Step │ │ Load_OCR_Output │
│ (stores output) │ │ (loaded auto.) │
│ ↓ │ triggers │ ↓ │
│ Trigger Action ──┼────────────→│ LLM / Agent Step │
│ Step │ │ (uses OCR text) │
└───────────────────┘ └───────────────────┘
Action A performs OCR and stores the result. A Trigger Action step fires Action B, which loads the OCR output automatically and feeds it to an LLM or Agent step.
Step 1 — Create the OCR Action (Action A)
- Create a new Action (or open an existing one).
- Add an OCR Step and select an OCR model.
- Check "Store OCR output for triggered actions" on the OCR step.
- Add a Trigger Action step after the OCR step and point it at the Action you want to trigger (Action B).
The checkbox tells Studio to store the OCR text so it can be retrieved by any Action triggered in the same chain.
Step 2 — Create the Processing Action (Action B)
- Create a new Action.
- On the step that needs the OCR data, add the Load_OCR_Output input.
- No configuration is needed — the input resolves the identifier automatically when the Action is triggered from a chain that stored OCR output.
- Use the loaded OCR text in your prompt or agent instructions. The OCR data is available as input context for the step.
How It Works Under the Hood
When the OCR step stores its output, it uses the current execution trace ID as the storage key. The Trigger Action step forwards that same trace ID to the triggered Action as __RootTraceId. The Load_OCR_Output input resolves {{inputs.__RootTraceId}} to look up the stored text — no manual identifier needed.
This also works in deeper chains. If Action B triggers Action C, and Action C has Load_OCR_Output, it still resolves back to the same root trace ID from Action A.
Things to Know
- 7-day retention — Stored OCR outputs expire after 7 days. Re-run the OCR Action if needed.
- Same-action usage — Within the same Action, reference OCR output directly via step outputs (e.g.,
{{StepName.ocrResult}}). The Store checkbox and Load_OCR_Output are only needed across Actions. - Custom identifiers — For advanced scenarios (e.g., keying by invoice ID), you can still set a custom identifier via the Raw Configuration on the OCR step and a matching configuration on the Load_OCR_Output input.