> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/cortex-xsoar-8-on-prem/8.14/configure-cortex-xsoar/playbooks/develop-your-playbook/task-3.-add-tasks.md).

# Task 3. Add tasks

Playbook tasks are the building blocks of playbooks. Tasks enable you to run scripts and sub-playbooks, communicate with end users, set conditions, and store relevant data.

Cortex XSOAR supports different task types for different actions to be taken in a playbook, and each task can receive and generate data in the form of inputs and outputs. For example, for enrichment, you might want to run an enrichment sub-playbook or a command that returns additional information for an indicator.

Tasks can be reused across playbooks and you can copy, cut, paste, and delete tasks within or between playbooks using keyboard shortcuts. To see a list of keyboard shortcuts, see [Keyboard shortcuts](/cortex-xsoar-8-on-prem/8.14/troubleshoot-and-reference/reference/keyboard-shortcuts.md).

The **Task Library** contains scripts, tasks, and playbooks. You can create new tasks from scripts, repurpose existing tasks, and use existing playbooks as sub-playbooks.

You can add a brief description for each task, explaining what the task does. Descriptions are added in the **Task Description** task field.

{% hint style="info" %}

### Note

To open multiple playbooks at the same time, edit the first playbook and then click the New icon next to the playbook name to create a new tab. You can either create a new playbook, or add an existing one.
{% endhint %}

Once you add tasks to your playbook, connect the tasks in their logical order by dragging and dropping a wire from one task to another.

| Task type       | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Section         | <p>Use a section header task to group related tasks to organize and manage the flow of your playbook.</p><p>Section headers can also be used for time tracking between phases in a playbook. This data can be used to display in dashboards and report time trends.</p><p>For example, in a phishing playbook you would have a section for the investigative phase of the playbook such as indicator enrichment, and a section for communication tasks with the user who reported the phishing.</p><p>For more information, <a href="/spaces/CkR7os5WSdK8uJZdAMGp/pages/ogV6Z30CmG0qfhFw0QEx">Create a section header</a>.</p>                                                                                                                                                                                                                                                                                                                              |
| Standard        | <p>Standard tasks can be manual tasks such as manual verification to prompt an analyst to verify the severity or classification of an incident before proceeding with automated actions. They can also be automated tasks such as parsing a file or enriching indicators.</p><p>Automated tasks are based on scripts that exist in the system. These scripts can be created by you or come out-of-the-box as part of a content pack. For example, the <strong><code>!ad-get-user</code></strong> command retrieves detailed information about a user account using the <strong>Active Directory Query V2</strong> integration.</p><p>You can also automatically remediate an incident by interacting with a third-party integration, open tickets in a ticketing system such as Jira, or detonate a file using a sandbox.</p><p>For more information, see <a href="/spaces/CkR7os5WSdK8uJZdAMGp/pages/zxnvBJnH2KsoSCdJBVsI">Create a standard task</a>.</p> |
| Conditional     | <p>Use conditional tasks to validate conditions based on values or parameters and take appropriate direction in the playbook workflow, like a decision tree in a flow chart.</p><p>For example, a conditional task may ask whether indicators are found. If yes, you can have a task to enrich them, and if not you can proceed to determine that the incident is not malicious. Alternatively, you can use conditional tasks to check if a certain integration is available and enabled in your system. If yes, you can use that integration to perform an action, and if not, you can continue on a different branch in the decision tree.</p><p>Conditional tasks can also be used to communicate with users through a single question survey, the answer to which determines how the playbook will proceed.</p><p>For more information, see <a href="/spaces/CkR7os5WSdK8uJZdAMGp/pages/KjABqnx5KslsP8jrZqmV">Create a conditional task</a>.</p>        |
| Data Collection | <p>Use a data collection task to interact with users through a survey, for example to collect responses or escalate an incident.</p><p>All responses are collected and recorded in the incident context data, from a single user or multiple users. You can use the survey questions and answers as input for subsequent playbook tasks.</p><p>You can collect responses in custom fields, for example, a grid field.</p><p>For more information, see <a href="/spaces/CkR7os5WSdK8uJZdAMGp/pages/rC64nlbutqTRUrDC9swj">Create a communication task</a>.</p>                                                                                                                                                                                                                                                                                                                                                                                                |

**Playbook task icons**

The different playbook tasks appear in the playbook editor with unique logos to more easily identify the task type and origin, for example third-party integration commands, built-in scripts and tasks, and tasks requiring manual inputs.

<details>

<summary>Playbook task icons in the playbook editor</summary>

| Task                                                       | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| ![standard\_task.png](/files/9q77YCReGfhx4osBuWQ4)         | <p><img src="/files/SMSoynqJLX2pwDrcyGNk" alt="arrow.png"><strong>Standard manual task</strong></p><p>An arrow with a light blue square background indicates a standard manual task. The following are kinds of standard tasks.</p><ul><li><p>Manual Standard task (no lightning bolt script logo):</p><p>These tasks are used where usually it's not possible to automate them. You can add comments, assign them to an owner, and set a due date. The analyst who is responsible for the investigation needs to complete the task before the playbook can continue running. A user icon ( <img src="/files/aaAEk6cowX29UXL6nSfm" alt="user_icon.png">) indicates the task requires manual inputs.</p></li><li><p>Automated Standard task (with lightning bolt script logo):</p><p>A single command or script that is set to automatically run when the playbook execution reaches this step. Some scripts need arguments in order to run - make sure to set them up properly. If left empty, the analyst who is responsible for the investigation will need to complete them so the script will run and the playbook can continue its execution.</p></li><li><p>Automated Standard task (with Builtin logo):</p><p>A single system command or script that is set to automatically run when the playbook execution reaches this step. Some scripts need arguments in order to run - make sure to set them up properly. If left empty, the analyst who is responsible for the investigation will need to complete them so the script will run and the playbook can continue its execution.</p></li><li><p>Automated Standard task (with Multi Command logo):</p><p>A generic single command or script that can be used with multiple integrations is set to automatically run when the playbook reaches this step. Some scripts need arguments in order to run - make sure to set them up properly. If left empty, the analyst who is responsible for the investigation will need to complete them so the script will run and the playbook can continue its execution.</p></li></ul> |
| ![condition\_task.png](/files/msUPGTyVU0tTwE85PzQg)        | <p><img src="/files/I5stt2JcBD9jc4ZS1Jhc" alt="conditional_icon.png"><strong>Conditional task</strong></p><p>A diamond icon in a purple square background indicates a conditional task used as decision trees in your playbook. The following are kinds of conditional tasks.</p><ul><li>Manual conditional task. A user icon ( <img src="/files/aaAEk6cowX29UXL6nSfm" alt="user_icon.png">) indicates the task requires manual inputs.</li><li>Automated conditional task (with the lightning bolt script logo).</li><li>Automated conditional task that uses a system script (with the Builtin logo).</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ![data\_collection\_task.png](/files/uRxlx6DrG68iUEm1UOc0) | <p><img src="/files/KNlaoK89sUjv2dczAuXq" alt="data_collection_icon.png"><strong>Data collection task / Communication task</strong></p><p>The speech bubble in a turquoise background indicates a data collection task. This task prompts the receivers to respond to a multi-question form and submit replies, even if they are not Cortex users. A user icon ( <img src="/files/aaAEk6cowX29UXL6nSfm" alt="user_icon.png">) indicates the task requires manual inputs.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ![sub-playbook\_task.png](/files/4fs1KoVShE18AaIXEGQp)     | <p><img src="/files/uiJDJd3uxj9FEQvWyIF6" alt="sub-playbook_icon.png"><strong>Sub-playbook task</strong></p><p>The workflow icon in a blue background indicates that the task is a playbook nested within the parent playbook. You can view the playbook by opening the task and selecting <strong>Open sub-playbook</strong>.</p><p>The red warning icon indicates the sub-playbook is not ready to use. Open it to review the errors.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ![task-error-new-logo.png](/files/Jmv270dtHgGPF62eUX7K)    | <p><strong>Task containing an error</strong></p><p>Scripts or sub-playbooks that have errors are designated by a red triangle. You need to open the script or sub-playbook to review the errors.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ![update\_scripts.png](/files/VDH4S1VJaiA3EZ9MdZT3)        | <p><strong>Task containing a deprecated script or needs to be updated</strong></p><p>Scripts or sub-playbooks that have updates or are deprecated are designated by a yellow triangle. You need to update the scripts, integration commands, or sub playbook tasks to their most current version.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ![skip.png](/files/fHA1UWHMF8tyJmal4daG)                   | <p><img src="/files/XNLb8KkrIU99ZlY1skxc" alt="skip_icon.png"><strong>Set to skip</strong></p><p>For the debugger, when a task is set to skip, the skip icon will be orange.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ![breakpoint.png](/files/geHQrv12dKm8F0aBCFSe)             | <p><img src="/files/FfIfQN7vCTt9NHPdwcJN" alt="breakpoint_icon.png"><strong>Breakpoint</strong></p><p>For the debugger, when the playbook reaches a breakpoint, the task has an orange line at the top to indicate the breakpoint.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ![overriden.png](/files/Zzc0HpL1vZnrzvgG5MLp)              | <p><img src="/files/WuzhBItJKJUZl79OiAvy" alt="overidden_icon.png"><strong>Overridden inputs or outputs</strong></p><p>For the debugger, when a task is set to have overridden inputs or outputs, the word Input or Output appears in orange.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ![pending.png](/files/pLFHdeaiY5kxV5KvHmw1)                | <p><img src="/files/AKmOIOjGfiN4h0pkY3V0" alt="pending_icon.png"><strong>Pending/in queue task</strong></p><p>When the playbook starts to run, all tasks that are about to be performed are gray.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ![running.png](/files/eTzPsrgqSqq07pSYA1r9)                | <p><img src="/files/9WtLZDI3m2DLMT5141li" alt="running_icon.png"><strong>Running/ in progress task</strong></p><p>A spinning circle inside the gray square indicates a running/in progress task.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ![completed.png](/files/82ytIMZSkxOgZFvU359W)              | <p><img src="/files/grAafDP5QxpqbUeGUtxZ" alt="completed_icon.png"><strong>Completed task</strong></p><p>The green square indicates a completed task.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ![waiting.png](/files/3jejlnJ0JUajgVnTlr7D)                | <p><img src="/files/yV9ImEC680rL3pBR899C" alt="waiting_icon.png"><strong>Waiting task</strong></p><p>The orange square indicates that the task is pending action.</p><p>If you hover over the icon on the top left corner, details about the reason the task is in waiting mode appear.</p><p>The user icon ( <img src="/files/aaAEk6cowX29UXL6nSfm" alt="user_icon.png">) indicates the task requires you to open it and manually mark it as complete.</p><p>A speech bubble icon (<img src="/files/pfTN92mawQWKDFWlakkB" alt="bubble_icon.png">) indicates the task is waiting for a questionnaire to be completed.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ![failed.png](/files/l195w5OfY6dQiCUEbVpz)                 | <p><strong>Failed task</strong></p><p>The red warning icon indicates that the automation failed to complete as expected and requires manual inspection and troubleshooting. Contact your Cortex XSOAR administrator.</p><p>If you hover on the icon on the top left corner, details about the specific problem appear.</p><p>If a red warning icon is paired with the clock icon (<img src="/files/qAqmVEYoNq4jkT2UjkTz" alt="hourglass_icon.png">), the task’s SLA is overdue.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ![skipped.png](/files/CWKLizJR4T0MfWI9ubzM)                | <p><img src="/files/UOexB2FVowVTgHLlWpHD" alt="skipped_icon.png"><strong>Skipped task</strong></p><p>The task will look faded to indicate it was not executed. This can happen if this task was set to be skipped when an error occurs, or if it is in a branch that was not executed if a condition wasn’t met.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://cortex-docs.paloaltonetworks.com/cortex-xsoar-8-on-prem/8.14/configure-cortex-xsoar/playbooks/develop-your-playbook/task-3.-add-tasks.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
