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

# Improve your workflows

> Make a working workflow faster, cheaper, and steadier.

## Ask Astro

The best way to find out how to improve your workflow is to ask Astro.

Very often, improving a step in a workflow is as simple as:

* ensuring the workflow is broken up into logical [steps](/concepts/nodes)
* improving your [instructions](/build/instructions)
* asking Astro to convert a node into [code](/operate/scripts) to make it faster, cheaper and more reliable.

| Ask                                | What Astro does                                                  |
| ---------------------------------- | ---------------------------------------------------------------- |
| "Which step is slowest?"           | Reads the timelines and names the node                           |
| "Where can this workflow improve?" | Reviews the graph and the instructions, and lists what to change |
| "Split this node into three"       | Rewrites the instructions and rewires the transitions            |
| "Script the login step"            | Writes the code, wires it to the node, and tests it              |

<Tip>
  Mentioning past executions with `@` gives Astro specific details of an individual execution.
</Tip>

Astro will then write your changes to a draft which you can publish when you're happy. See [Build in the platform](/build/in-the-platform).

***

## Find the step that costs you

Watch the recording of a slow execution and find the steps where the workflow spends the most time.

The activity log gives you the same answer with numbers. A `transitioned_node` entry may carry `fromNodeDuration`, the seconds the previous node took. See [Debug your workflows](/operate/debug).

***

## Split a node that does too much

A node that logs in, searches, opens a record, and fills a form has four ways to go wrong. It has one place to describe them all. It also burns turns. A node that runs out of turns ends the execution as `cancelled` with the reason `max_steps`.

Split it. One node, one job, one observable end state. Each node then gets its own transitions, so a failure lands on the right path instead of ending the execution.

Ask Astro to do the split. It rewrites the instructions for each new node and rewires the transitions.

See [Nodes](/concepts/nodes) and [Transitions](/concepts/transitions).

***

## Turn a proven path into a script

A node that takes the same actions every execution does not need a model to pick them. Give it a Playwright script and those actions replay in milliseconds, for no model cost.

<Card title="Scripts" icon="file-code" href="/operate/scripts" horizontal>When to script a node, how to attach one, what it returns, and what happens when it fails</Card>

***

## Feed real failures back into the instructions

Every failure you debug is a sentence the instructions were missing.

The workflow hit a cookie banner. Add the edge case. The workflow picked the wrong search result. Add the success criteria. The workflow submitted the form twice. Say what "done" looks like.

Structure each node's instructions the same way:

* **Goal** — what the node accomplishes.
* **Ordered steps** — the actions, in sequence.
* **Edge cases** — the variations you have seen in real executions.
* **Success criteria** — the condition the workflow can observe when it is finished.

Then publish a new version and watch the Stats tab. See [Write good instructions](/build/instructions) and [Versions and publishing](/concepts/versions).

<Info>
  Change one thing at a time. Two changes in one version make a moved number impossible to attribute.
</Info>

***

## Next

<CardGroup cols={2}>
  <Card title="Debug your workflows" icon="bug" href="/operate/debug" horizontal>Find the step that broke, and why</Card>
  <Card title="Write good instructions" icon="pen-line" href="/build/instructions" horizontal>Goal, steps, edge cases, success criteria</Card>
  <Card title="Scripts" icon="file-code" href="/operate/scripts" horizontal>Replay a proven path with no model call</Card>
  <Card title="Test, iterate, publish" icon="check-check" href="/build/test-and-publish" horizontal>Ship the change</Card>
</CardGroup>
