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

# Decision Required

> Let a person decide when a recovery reaches a consequential choice

Some failures cannot be fixed safely by the [Maintenance Agent](https://docs.cloudcruise.com/concepts/maintenance-agent.md) alone, for example a page that asks to accept terms, confirm a change or pick between options with real consequences. With Decision Required, the agent does not guess. It asks a person, the run waits, and the recovery continues from the answer.

> [!NOTE]
>
> Decision Required is enabled per workspace. It needs a connected [Slack](https://docs.cloudcruise.com/integrations/slack.md) workspace and a channel the CloudCruise bot has been invited to, also when you answer through the API. Contact CloudCruise to turn it on.

## How it works

1. A run hits a blocker that needs a consequential choice.
2. CloudCruise posts a decision card in your Slack channel with the question, what the run has done so far and the answer options. Webhooks subscribed to [`agent.decision_requested`](https://docs.cloudcruise.com/concepts/webhooks) receive the same question.
3. The run waits while the card is open.
4. A person answers, the agent continues the recovery and the run resumes. [`agent.decision_answered`](https://docs.cloudcruise.com/concepts/webhooks) reports how the decision closed.

The first accepted answer wins, wherever it comes from. Later answers and answers from someone who is not allowed to answer are rejected, and that person is told privately.

## Where you can answer

| Where | Who can answer |
| - | - |
| The Slack card | People whose Slack email matches a CloudCruise administrator profile |
| The run page | CloudCruise administrators |
| The API at the `respond_url` of `agent.decision_requested` ([Answer a decision](https://docs.cloudcruise.com/run-api/answer-a-decision.md)), or the [CLI](https://docs.cloudcruise.com/sdk/cli/overview.md) | An API key of the run's workspace |

Without webhooks, read the open question with `GET /run/{session_id}/decision/pending` or `cloudcruise run decision <session_id>`.

## Answer options

| Option | What it does |
| - | - |
| The question's choices | Pick a choice the page offers, or fill in the fields the agent asks for |
| Free text | Tell the agent what to do in your own words |
| Requeue | Stop this attempt and run the workflow again later |
| [Add Error Code](#add-error-code) | Stop the run with an error code, so the same failure stops with it next time |
| Fail Run | Stop the run with its original error |

## Add Error Code

The agent usually suggests a code with the question: one of your workspace's codes, or a new one in your naming, such as `PORTAL-E004`, with a short description.

**Add Error Code** opens a confirmation where you can rename the code and pick its **Behavior**, the same choices as in **Error Handling > Error Codes**; only **Stop run and notify** changes how a run ends today. **Add and stop run** stops the run with that code and saves it. Depending on your workspace, the code is either added to the step in a new workflow version right away, so later runs stop with it without asking, or waits for approval in **Error Handling > Error Codes**. The confirmation says which.

Through the API or CLI, `add_error_code` saves the suggestion as it is. Without a suggestion, it only stops the run.

## If nobody answers

A card waits 5 minutes by default; a workspace or workflow can set 30 to 600 seconds. When the time runs out, the run stops with its original error and the card says it timed out. The agent never makes the choice on its own.

The expired card still offers **Answer anyway to save it for next time**. A late answer does not resume the run; it is offered the next time the same error happens. See [Remembered decisions](https://docs.cloudcruise.com/concepts/remembered-decisions.md).

If a card cannot be sent, for example when no channel is configured or the run fails outside the active hours of your decision notification rules, the recovery continues without asking. CloudCruise also limits how many cards a recovery, a run and a workspace can open, and does not resend an identical card for a period.

## Deprecation: `input_required`

The `input_required` error-code action is retired. New codes cannot use it, and existing ones were converted to `alert`. The `execution.input_required` webhook event and `POST /run/{session_id}/new_input_variables` were removed; subscribe to [`agent.decision_requested`](https://docs.cloudcruise.com/concepts/webhooks) and answer at its `respond_url` instead.

## Related

* [Remembered decisions](https://docs.cloudcruise.com/concepts/remembered-decisions.md)
* [Decision data handling](https://docs.cloudcruise.com/concepts/decision-data-handling.md)


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