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

# Fix with AI

> Repair a failed integration step from the task view: copilot diagnoses the error, proposes one fix, and applies it and reruns the step only after you say yes.

When an integration step fails, the task view shows the raw error and leaves the repair to you. **Fix with AI** hands that work to copilot. It reads the failure, explains it in plain language, proposes a single change, and waits. Nothing is applied until you agree in the chat.

<Frame caption="Tasks <span>→</span> task <span>→</span> failed step <span>→</span> Output">
  <img src="https://mintcdn.com/beamai/mzjYglzHZw7mcBH3/03-running-operations/debugging-testing/fix-with-ai/failed-step-fix-with-ai.png?fit=max&auto=format&n=mzjYglzHZw7mcBH3&q=85&s=0ed5d08c15a28ec4e4024d370af3a7ac" alt="A failed Gmail step in the task view, with the red Error card in its Output section and the Fix with AI button at the top of the card" width="1880" height="1082" data-path="03-running-operations/debugging-testing/fix-with-ai/failed-step-fix-with-ai.png" />
</Frame>

<Info>
  **Fix with AI** relies on copilot, the **Beam AI** panel that opens from the icon in the top-right of the app. If copilot is not enabled for your workspace, the button does not appear.
</Info>

<h2 id="what-fix-with-ai-is">
  What Fix with AI is
</h2>

<h3 id="the-loop-it-runs">
  The loop it runs
</h3>

Every fix follows the same five moves, and you are in the chat for all of them.

| Move | What copilot does |
| - | - |
| Diagnose | Reads the error the integration returned, the step's settings, and what the step was meant to do, then tells you what broke in one or two sentences |
| Propose | Suggests one specific change, with the reasoning behind it and how confident it is |
| Ask | Ends with a question and waits for your answer |
| Apply and rerun | On a clear yes, makes the change and reruns the failed step |
| Report | Tells you what changed, before and after, and whether the rerun succeeded |

It never proposes more than one fix at a time, and it never applies a fix on an unclear answer. A reply like "maybe" gets a follow-up question, not a change.

<h3 id="what-it-can-and-cannot-fix">
  What it can and cannot fix
</h3>

Fix with AI edits the step's configuration: a parameter with the wrong value, a field in the wrong format, a value that should have come from an earlier step. Those are the failures it can repair and rerun on its own.

Some failures are not the step's fault, and copilot says so instead of guessing.

* An expired or missing connection, where the integration reports an authentication or permission error. Copilot points you to reconnecting the integration rather than editing the step.
* A rate limit or an outage on the provider's side. Copilot explains the cause and suggests what to do, and applies nothing.
* A failure it cannot find a plausible fix for. You get the diagnosis and manual next steps.

<Warning>
  The fix is applied to the failed task and to the agent's draft Flow. It is not published. Tasks that arrive later keep running the published Flow until you publish the draft, so if the fix should stick, open the Flow and publish it. Publishing is covered in [Publishing & Deployment](/02-building-agents/advanced-patterns/publishing-deployment/publishing-deployment).
</Warning>

<h3 id="what-it-remembers">
  What it remembers
</h3>

When a fix works, copilot saves it to that agent's memory, keyed to the kind of failure it solved. The next time the same failure appears on this agent, on any task and any step that uses the same integration action, copilot skips the diagnosis and proposes the remembered fix straight away. It still asks before applying it. Memory is per agent; a fix learned on one agent does not carry to another.

<h3 id="where-it-lives">
  Where it lives
</h3>

The button sits inside the red **Error** card in a failed step's **Output** section, in the task view. Open a task from **Tasks**, select the step marked as failed, and open **Parameters**. The step detail panel itself is described in [Task Executions](/03-running-operations/task-management/task-executions/task-executions#workflow-step-breakdown).

<Info>
  Fix with AI works on **integration steps**: the ones that call Gmail, Slack, Salesforce, and so on. You may see the button on other failed steps too, but copilot can only diagnose and repair an integration call. For a failed prompt step, edit the step in the Flow instead.
</Info>

<h2 id="how-to-use-fix-with-ai">
  How to use Fix with AI
</h2>

<h3 id="fix-a-failed-step">
  Fix a failed step
</h3>

<Steps>
  <Step title="Open the failed task">
    Go to **Tasks** and select the task. Failed tasks carry the **Failed** status in the list.
  </Step>

  <Step title="Select the failed step">
    In **Task execution**, select the step marked as failed. Its detail panel opens on **Parameters**, and the **Output** section shows the red **Error** card with what the integration returned.
  </Step>

  <Step title="Select Fix with AI">
    The button is at the top of the **Error** card. Copilot opens and starts on the diagnosis without you typing anything.
  </Step>

  <Step title="Read the diagnosis and the proposed fix">
    Copilot posts what broke, the one change it wants to make, why, and how confident it is, then asks whether to go ahead.

    Sometimes there is nothing on the step to change. When the cause is an expired or broken connection, as in the example below, copilot says so, leaves the agent untouched, and points you to **Integrations** to reconnect. Rerun the task once the connection is back.

    <Frame caption="Tasks <span>→</span> task <span>→</span> failed step <span>→</span> Fix with AI <span>→</span> copilot">
      <img src="https://mintcdn.com/beamai/mzjYglzHZw7mcBH3/03-running-operations/debugging-testing/fix-with-ai/copilot-proposed-fix.png?fit=max&auto=format&n=mzjYglzHZw7mcBH3&q=85&s=152768299244215af350e61412eaefc6" alt="The failed Gmail step's Error card with the Fix with AI button, beside the copilot panel diagnosing the failure as an expired connection rather than a setting" width="1484" height="970" data-path="03-running-operations/debugging-testing/fix-with-ai/copilot-proposed-fix.png" />
    </Frame>
  </Step>

  <Step title="Answer in the chat">
    Say yes to apply the fix, using one of the replies copilot offers or by typing. Say no and nothing changes; the step stays failed and you can ask for a different approach or handle it yourself.

    <Note>
      If you would rather understand the failure than fix it, say so. Copilot explains and stops there, and the task is left exactly as it was.
    </Note>
  </Step>

  <Step title="Check the rerun">
    After a yes, copilot applies the change, reruns the step, and reports the result: what it changed, the old and new values, and the step's new status. The task view updates as the rerun completes.
  </Step>
</Steps>

<Tip>
  Closing the copilot panel mid-way is safe. Nothing is applied until you answer, and the conversation is still there when you reopen it.
</Tip>

<h3 id="rerun-other-tasks-that-failed-the-same-way">
  Rerun other tasks that failed the same way
</h3>

After a successful fix, copilot checks whether other tasks on this agent failed on the same step and offers to rerun them with the corrected settings. It lists them and asks first. Say yes to rerun the batch, or no to leave them for later.

<h3 id="change-the-proposal">
  Change the proposal
</h3>

A proposal is a conversation, not a form. If the suggested value is close but not right, reply with the value you want and copilot revises the proposal and asks again. If the rerun fails after a fix, copilot reports the new error and offers one more attempt with a different approach, or hands the step back to you. It does not keep retrying on its own.

<h2 id="troubleshooting">
  Troubleshooting
</h2>

<AccordionGroup>
  <Accordion title="There is no Fix with AI button on my failed step">
    **Cause**: Either copilot is not enabled for the workspace, or the step did not fail with an error the card can show.

    **Solution**:

    * Check for the copilot icon in the top-right of the app. If it is missing, copilot is off for the workspace.
    * Confirm the step's status is **Failed** and its **Output** section shows the red **Error** card. The button lives on that card.
  </Accordion>

  <Accordion title="Copilot says it cannot fix this and points me elsewhere">
    **Cause**: The failure is an expired connection, a permission problem, a rate limit, or an outage at the provider. None of those is a setting on the step.

    **Solution**:

    * For an authentication or permission error, reconnect the integration and rerun the task. See [Integrations](/02-building-agents/agent-configuration/integrations/integrations).
    * For a rate limit or provider error, wait and rerun the task from the task view. See [Rerunning Tasks](/03-running-operations/debugging-testing/rerunning-tasks/rerunning-tasks).
  </Accordion>

  <Accordion title="The step succeeded after the fix, but the next task failed the same way">
    **Cause**: The fix was applied to the failed task and the draft Flow. New tasks run the published Flow, which still has the old settings.

    **Solution**:

    * Open the agent's Flow and publish the draft.
    * Then, for the task that failed, use **Fix with AI** again. Copilot recognises the failure from memory and proposes the same fix straight away.
  </Accordion>
</AccordionGroup>

<h2 id="next-steps">
  Next steps
</h2>

<CardGroup cols={2}>
  <Card title="Task Executions" icon="chart-line" href="/03-running-operations/task-management/task-executions/task-executions">
    Find the failed step and read what the integration returned.
  </Card>

  <Card title="Rerunning Tasks" icon="rotate" href="/03-running-operations/debugging-testing/rerunning-tasks/rerunning-tasks">
    Rerun a whole task after a change, or set steps to retry on their own.
  </Card>

  <Card title="Monitoring" icon="bell" href="/02-building-agents/agent-configuration/monitoring/monitoring">
    Get told in Slack, Teams, or email when a task fails, so you reach this page sooner.
  </Card>

  <Card title="Integrations" icon="plug" href="/02-building-agents/agent-configuration/integrations/integrations">
    Reconnect an integration when the failure is the connection, not the step.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.