When to use chain mode
Large financial models
Revenue, COGS, gross profit, OpEx, EBITDA, and a DCF terminal value all in one run — chain mode handles the full structure without you clicking Apply on each row.
Multi-section workbooks
Any model with more than three or four sections benefits from chain mode. The agent tracks which sections it has written and which remain.
Formula-dependent builds
Chain mode observes the computed values of formulas after each write, so it can use those values to inform subsequent sections — for example, using a computed revenue figure to seed the COGS row.
Template-like builds from prompts
Describe a full workbook in one prompt and let the agent build it end-to-end, just like opening a template but tailored exactly to your spec.
How chain mode works
Send your prompt
Type your full build request in the chat composer and select Chain mode (instead of the default single-turn mode) before submitting.
The agent declares a plan
On the first turn, the agent emits a plan — a structured preview of every section it intends to fill, with target ranges and notes. This plan is shown to you before any cells are written. The agent also writes the first section only on this turn.
GridOS auto-applies each step
After writing a section, GridOS applies it to the kernel immediately — no click required. It then reads back the computed values of any formula cells and feeds those observations into the agent’s next prompt.
The agent writes the next section
Informed by the observed formula results (and any warnings), the agent writes the next section. This repeats until every section in the plan is complete.
The plan preview
The plan is informational — it shows you the full structure the agent intends to build before cells are filled. It is emitted only on the first turn and suppressed on all subsequent turns. Each section in the plan includes:| Field | Description |
|---|---|
| label | Human-readable name for the section (e.g. “Revenue”, “COGS”) |
| target | The cell range the agent will write (e.g. B3:F3) |
| notes | Brief description of the formula logic or values |
The plan is a preview, not a commitment. If the agent detects that a section needs to be retried (because of a column-alignment warning), it rewrites that section before advancing — the plan section count may not match the number of loop iterations exactly.
Column alignment auto-retry
GridOS detects the most common formula error in financial models — referencing a label cell instead of the adjacent data cell — and triggers an automatic retry when it occurs. After applying each section, GridOS checks whether any formula references a text-valued cell. If it does, the agent receives a detailed warning and is told to re-emit the same section with corrected cell references before moving to the next section.Iteration limits
Chain mode runs for up to 10 iterations by default. Each application of a section (including retries) counts as one iteration. You can reduce the limit by passingmax_iterations in the API request if you want shorter runs during development.
Stopping chain mode
Chain mode stops automatically when any of the following happen:- The agent returns an empty
values=[[""]]completion signal - The maximum number of iterations is reached
- The agent has no formula observations remaining and the plan is complete
Chain mode vs. regular chat
| Regular chat | Chain mode | |
|---|---|---|
| Apply step | Manual — you click Apply after each response | Automatic — applied immediately after each step |
| Formula observation | Not fed back to the agent | Yes — computed values are included in the next prompt |
| Column alignment retry | You see the error and re-ask manually | Automatic — the agent retries the section before moving on |
| Plan tracking | Agent tracks progress informally | Agent tracks sections written vs. remaining, with explicit hints |
| Best for | Single writes, quick edits, questions | Large multi-section builds, full model generation |