> 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.11/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.11/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. When you view your playbook, clicking the <img src="/files/c9JpuxpFvm6X58LnV6ju" alt="playbook-info-icon.png" data-size="line"> icon for a task displays the description, without requiring you to open the task.

{% 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>You can easily navigate playbooks and focus on the parts you need to work on by collapsing and expanding playbook sections. Collapsing sections provides a condensed view of the playbook flow, reducing visual clutter and enabling quick access to specific sections. Expanding sections allows you to view or edit specific parts of a playbook while keeping the rest of the playbook compact and maintaining focus on the relevant playbook details. You can also hover over a Section Header to highlight all tasks under the section and easily identify the section scope.</p><p>For more information, <a href="/spaces/zu0JFveya8HggDUkscbw/pages/FdtBreRALVMc4CPXvRTz">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/zu0JFveya8HggDUkscbw/pages/FfVybFDVtFL4ELyui2Lj">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 a playbook will proceed.</p><p>For more information, see <a href="/spaces/zu0JFveya8HggDUkscbw/pages/zN50jHQefBJW69QqVdYZ">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/zu0JFveya8HggDUkscbw/pages/0lYzx6RJcYmJbWWXxT3m">Create a communication task</a>.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |


---

# 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.11/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.
