> 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.12/configure-cortex-xsoar/playbooks/develop-your-playbook/task-3.-add-tasks/create-a-communication-task.md).

# Create a communication task

Communication tasks enable you to send surveys to users, both internal and external, to collect data for an incident. The collected data can be used for incident analysis, and also as input for subsequent playbook tasks. For example, you can send a scheduled survey requesting analysts to send specific incident updates or send a single (stand-alone) question survey to determine how an issue was handled.

There are two types of communication tasks:

* **Ask tasks**: A conditional task that sends a single question survey. The answer is used to determine how the playbook proceeds.
* **Data collection tasks**: A data collection task sends a survey of one or more questions. The answers are recorded in context data and can be used as input for subsequent tasks.

<details>

<summary>About Ask tasks</summary>

An ask task is a type of conditional task that sends a single question survey, the answer to which determines how a playbook proceeds. If you send the survey to multiple users, the first answer received is used, and subsequent responses are disregarded. For more information about ask task settings, see [Create a conditional task](/cortex-xsoar-8-on-prem/8.12/configure-cortex-xsoar/playbooks/develop-your-playbook/task-3.-add-tasks/create-a-conditional-task.md).

Because this is a conditional task, you need to create a condition for each of the answers. For example, if the survey answers include, **`Yes, No, and Maybe`**, there should be a corresponding condition (path) in the playbook for each of these answers.

Users interact with the survey directly from the message, meaning the question appears in the message and they click an answer from the message.

The survey question and the first response is recorded in the incident context data. This enables you to use this response as the input for subsequent playbook tasks.

For all ask conditional tasks, a link is generated for each possible answer the recipient can select. If the survey is sent to more than one user, a unique link is created for each possible answer for each individual recipient. These links are visible in the context data of the incident's Work Plan. The links appear under Ask.Links in the context data.

In this example, the message and survey will be sent to recipients every hour for six hours, until a reply is received (it is repeated every 60 minutes, 6 times). The SLA is six hours. If the SLA is breached, the playbook will proceed according to the Yes condition.

[![ask-timer.png](https://docs-cortex.paloaltonetworks.com/api/khub/maps/_pgJmah_jOQZMdDuGbjUsg/resources/fVVoBdQK6mfYL6eWqqgeWg-_pgJmah_jOQZMdDuGbjUsg/content?v=1a7ca3cd9c24b294\&Ft-Calling-App=ft/turnkey-portal)](https://docs-cortex.paloaltonetworks.com/viewer/attachment/_pgJmah_jOQZMdDuGbjUsg/fVVoBdQK6mfYL6eWqqgeWg-_pgJmah_jOQZMdDuGbjUsg)<br>

In this example, a message and survey are sent by email to all users with the Analyst role. We are not including a message body because the message subject is the survey question we want recipients to answer. There are three reply options, Yes, No, and Not sure. In the playbook, we will only add conditions for the Yes and No replies. We require recipient authentication, which first involves setting up authentication.

[![ask-task-example-email-8-4.png](https://docs-cortex.paloaltonetworks.com/api/khub/maps/_pgJmah_jOQZMdDuGbjUsg/resources/w~Ghf~Z3B3Z8bCT2xHf2yQ-_pgJmah_jOQZMdDuGbjUsg/content?v=fd28f60fe02fcbad\&Ft-Calling-App=ft/turnkey-portal)](https://docs-cortex.paloaltonetworks.com/viewer/attachment/_pgJmah_jOQZMdDuGbjUsg/w~Ghf~Z3B3Z8bCT2xHf2yQ-_pgJmah_jOQZMdDuGbjUsg)

</details>

<details>

<summary>Create a data collection task</summary>

The data collection task is a multi-question survey (form) that survey recipients access from a link in the message. Users do not need to log in to access the survey, which is located on a separate site.

All responses are collected and recorded in the incident context data, whether you receive responses from a single user or multiple users. This enables you to use the survey questions and answers as input for subsequent playbook tasks. If responses are received from multiple users, data for multi-select fields and grid fields are aggregated. For all other field types, the response received most recently will override previous responses as it displays in the field. All responses are always available in the context data.

For all data collection tasks, a single link is generated for each recipient of the survey. These links are visible in the context data of the incident's Work Plan. The links appear in the context data under the Links section of that survey.

You can include the following types of questions in the survey.

* Stand alone questions. These are presented to users directly in the message, and from which users answer directly in the message (not an external survey).
* Field-based questions. These are based on a specific incident field (either system or custom), for example, an Asset ID field. The response (data) received for these fields automatically populates the field for this Incident. For single-select field based questions, the default option is taken from the field’s defined default.

How to create a Data Collection task

1. In a playbook, click + to create a new task.
2. Select the Data Collection option.
3. Enter a meaningful name in the Task Name field for the task that corresponds to the data you are collecting.
4. Select the communication options you want to use to collect the data.

   **Tabs and configuration fields**

   | Tab       | Configuration fields in the tab                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
   | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   | Message   | <ul><li><p>Ask by: The method for sending the message and survey. Options are:</p><ul><li>Task (can always be completed directly in the Workplan)</li><li>Generated link (appears in the context data): A link to the data collection survey is available in the context data of the task.</li><li>Email: If you select this option, enter below the subject and message of the email and the email addresses of the users who should receive this message or survey.</li></ul></li><li><p>To: The message and survey recipients. You can define by:</p><ul><li>Selecting from a predefined drop down list.</li><li>Manually typing email addresses for users and/or external users.</li><li>Clicking the context icon to define recipients from a context data source.</li></ul></li><li>CC of the email: A CC email address.</li><li>Subject of the email: The message subject that displays to message recipients. You can write the survey question in the subject field or in the message body field.</li><li>Message body: The message question body to be used in the notification sent to the given users along with the reply options.</li><li>Require users to authenticate: Enable this option to have your SAML or AD authenticate the recipient before allowing them to answer. You must first set up an authentication integration instance and check Use this instance for external users authentication only in the integration instance settings.</li></ul> |
   | Questions | <ul><li>Web Survey Title: The title displayed for the web survey.</li><li>Short Description: A description displayed above the questions on the web survey. Click Preview to see how it displays.</li><li>Question: A question to ask recipients.</li><li><p>Answer Type: The field type for the answer field. Options are:</p><ul><li>Short text</li><li>Long text</li><li>Number</li><li>Single Select (requires you to define a reply option)</li><li>Multi select/Array (requires you to define a reply option)</li><li>Date picker</li><li>Attachments</li></ul></li><li>Mandatory: If this checkbox is selected for a question, survey recipients will not be able to submit the survey until they answer this question.</li><li>Help Message: The message that displays when users hover over the question mark help button for the survey question.</li><li>Placeholder: A sample value displayed until a real value is entered.</li></ul><p>You can drag questions to rearrange the order in which they display in the survey.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                  |
   | Timing    | <ul><li>Retry interval (minutes): Determines the wait time between each execution of a command. For example, the frequency (in minutes) that a message and survey are resent to recipients before the response is received.</li><li><p>Number of retries: Determines how many times a command attempts to run before generating an error. For example, the maximum number of times a message is sent. If a reply is received, no additional retry messages will be sent.</p><p>Retries are not supported for data collection tasks that have errors sending emails (indicated by a server timeout). This is because retries only work on automation execution failures, not on email delivery issues.</p></li><li>Task SLA: Set the SLA in granularity of weeks, days, and hours.</li><li>Set task Reminder at: Set a task reminder in granularity of weeks, days, and hours.</li><li><p>Complete automatically if:</p><ul><li>Reached task SLA (with or without a reply): This option is grayed out.</li><li>Received \<enter a number> reply</li></ul></li></ul>                                                                                                                                                                                                                                                                                                                                                                                                           |
   | Details   | <ul><li>Tag the result with: Add a tag to the task result. You can use the tag to filter entries in the War Room.</li><li>Task description (Markdown supported): Provide a description of what this task does. You can enter objects from the context data in the description. For example, in a communication task, you can use the recipient’s email address. The value for the object is based on what appears in the context every time the task runs.</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
   | Advanced  | <ul><li>Using: Choose which integration instance will execute the command, or leave empty to use all integration instances.</li><li>Extend context: Append the extracted results of the action to the context. For example, "newContextKey1=path1::newContextKey2=path2" returns "\[path1:'aaa',path2: 'bbb', newContexKey1: 'aaa',newContextKey2:'bbb']"</li><li>Ignore outputs: If set to true, will not store outputs into the context (besides the extended outputs).</li><li>Execution timeout (seconds): Sets the command execution timeout in seconds.</li><li><p>Indicator Extraction mode: Choose when to extract indicators:</p><ul><li>None: Do not perform indicator extraction</li><li>Inline: Before other playbook tasks</li><li>Out of band: While other tasks are running</li></ul></li><li>Mark results as note</li><li>Mark results as evidence</li><li>Run without a worker</li><li>Skip this branch if this script/playbook is unavailable</li><li>Quiet Mode: When in quiet mode, tasks do not display inputs and outputs or extract indicators. Errors and warnings are still documented. You can turn quiet mode on or off at the task or playbook level.</li></ul>                                                                                                                                                                                                                                                                                  |
5. (Optional) To customize the look and feel of your email message, click Preview.

   You can determine the color scheme and how the text in the message header and body appear, as well as the appearance and text of the button the user clicks to submit the survey.

</details>

<details>

<summary>Data collection task examples</summary>

Stand-alone question with a single-select answer

In this example, we create a stand-alone question, with a single-select answer. This question is not mandatory. If we selected the First option is default checkbox, the reply option "0" is the default value in the answer field.

[![data-collection-eg.png](https://docs-cortex.paloaltonetworks.com/api/khub/maps/_pgJmah_jOQZMdDuGbjUsg/resources/GRWKDme7iZ46pSl9B8oYxw-_pgJmah_jOQZMdDuGbjUsg/content?v=5d88ad644d2dee03\&Ft-Calling-App=ft/turnkey-portal)](https://docs-cortex.paloaltonetworks.com/viewer/attachment/_pgJmah_jOQZMdDuGbjUsg/GRWKDme7iZ46pSl9B8oYxw-_pgJmah_jOQZMdDuGbjUsg)

In this example, we create a question based on a custom grid field that we mark as mandatory. For the question field, we included a descriptive sentence explaining how to fill in the grid.

[![data-collection-task-example-field-based-8-0.PNG](https://docs-cortex.paloaltonetworks.com/api/khub/maps/_pgJmah_jOQZMdDuGbjUsg/resources/XsK3taBYyVZb6cmKNKTNsg-_pgJmah_jOQZMdDuGbjUsg/content?v=c4daca9a0955d16d\&Ft-Calling-App=ft/turnkey-portal)](https://docs-cortex.paloaltonetworks.com/viewer/attachment/_pgJmah_jOQZMdDuGbjUsg/XsK3taBYyVZb6cmKNKTNsg-_pgJmah_jOQZMdDuGbjUsg)

</details>

<details>

<summary>Configure communication task authentication</summary>

When sending a form in a communication task, you can configure user authentication to ensure only authorized users gain access to the form.

The authorized users are usually external users not in Cortex XSOAR, and they will not be able to access anything else in Cortex XSOAR.

Set up playbook communication task authentication

1. Set up your SSO if it is not already configured. See [Authenticate users using SSO](/cortex-xsoar-8-on-prem/8.12/configure-cortex-xsoar/users-and-roles-management/set-up-authentication/authenticate-users-using-sso.md) for more details.
2. In the Task details of your playbook communication task, check Require users to authenticate to have your SAML or AD authenticate the recipient before allowing them access to the form.

   [![playbook-comm-task-authenticate-2.png](https://docs-cortex.paloaltonetworks.com/api/khub/maps/_pgJmah_jOQZMdDuGbjUsg/resources/WY1ilQhvdnJeShoWd42tlQ-_pgJmah_jOQZMdDuGbjUsg/content?v=d913ac2050c4b630\&Ft-Calling-App=ft/turnkey-portal)](https://docs-cortex.paloaltonetworks.com/viewer/attachment/_pgJmah_jOQZMdDuGbjUsg/WY1ilQhvdnJeShoWd42tlQ-_pgJmah_jOQZMdDuGbjUsg)

</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.12/configure-cortex-xsoar/playbooks/develop-your-playbook/task-3.-add-tasks/create-a-communication-task.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.
