# Batch workflow commands

Tasks executed during *batch* workflows set some values using commands. To execute a command, a task should print a specifically formatted line to the standard output stream. Apolo Flow automatically scans this stream and detects commands in it.

## `set-output` command

Sets the value of a task's output that can be later accessed by other tasks using the [`needs` context](/index/apolo-flow-reference/workflow-syntax/batch-workflow-syntax/batch-contexts.md#needs-context).

**Format:**

`::set-output name={name}::{value}`

**Example:**

```
echo "::set-output name=output_name::value of the output_name"
```

## `save-state` command

Saves some value in the `main` task of a [stateful action](/index/apolo-flow-reference/workflow-syntax/actions-syntax.md#kind-stateful-actions) that can be later accessed by other `post` using the [`state` context](/index/apolo-flow-reference/workflow-syntax/actions-syntax/live-actions-contexts.md#state-context).

**Format:**

`::save-state name={name}::{value}`

**Example:**

```
echo "::save-state name=resource_id::id of some resource"
```

## `stop-commands` command

Temporarily disables the processing of commands until an `::{end_token}::` is found in the output.

**Format:**

`::stop-commands::{end_token}`

**Example:**

```
echo "::stop-commands::this will not appear in the file"
cat some-file.txt
echo "::this will not appear in the file::"
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.apolo.us/index/apolo-flow-reference/workflow-syntax/batch-workflow-syntax/batch-workflow-commands.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
