Task 3. Add tasks
Add tasks to a playbook in Cortex XSOAR 8.10 On-prem.
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.
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
icon for a task displays the description, without requiring you to open the task.
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.
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.
Section
Use a section header task to group related tasks to organize and manage the flow of your playbook.
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.
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.
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.
For more information, see Create a section header.
Standard
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.
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 !ad-get-user command retrieves detailed information about a user account using the Active Directory Query V2 integration.
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.
For more information, see Create a standard task.
Conditional
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.
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.
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.
For more information, see Create a conditional task.
Data Collection
Use a data collection task to interact with users through a survey, for example to collect responses or escalate an incident.
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.
You can collect responses in custom fields, for example, a grid field.
For more information, see Create a communication task.
Set playbook inputs and outputs
Depending on the task type that you select and the script that you are running, your playbook task may have inputs and outputs.
Inputs are data pieces used in a task. The inputs are often manipulated or enriched and they produce outputs. Outputs generated from the result of a task or command can be used as inputs to subsequent tasks or as information generated to help resolve or escalate an investigation.
An input may come from an incident, such as the role to assign an incident to, or an input can be provided by an integration, for example the Active Directory integration can be used in a task to extract a user's credentials.
At the beginning of any playbook, click the Playbook Triggered task and enter the playbook inputs and outputs, grouping them as relevant.
Create a section header
Section headers are used to manage the flow of your playbook and help you organize your tasks efficiently. You create a section header to group a number of related tasks.
Section headers can also be used for time tracking between phases in a playbook. When you start time tracking, apply the Start action for the section header. Because you are using this to time track a particular phase of an investigation, add a stop timer section header when the phase completes. The time tracking data can be used to display in dashboards and report time trends.
In a playbook, click + to create a task.
Select the Section Header option.
Enter a meaningful name in the Task Name field for the section header.
Configure the relevant fields.
TabFields in the tabDetails
Tag the result with: Add a tag to the task result. You can use the tag to filter entries in the War Room.
Sub Section: If selected, this section becomes a subsection of the parent section above it, and it collapses when its parent section collapses.
Task description (Markdown supported): Provide a description of what this task does. In the Playbooks page, click
on the section header to display the description.
Timers
For a time tracking header, select the action to take when the timer is triggered (start, stop, or pause).
Timer.start: The trigger for starting to send a message or survey to recipients. You can change this trigger or add a trigger for Timer.stop or Timer.pause. Select the trigger timer field from the drop down.
Add Trigger: You can add other trigger timer fields from the drop down.
Click Save.
Collapse and expand playbook sections
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.
To collapse and expand a section, in the Playbooks page, after selecting a playbook from the library or creating a new playbook and adding tasks, click
on a section header.
When you collapse a section, you can see the number of tasks included under the section. For example:

Click
to collapse or expand the entire playbook.
Create a standard task
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.
In a playbook, click + to create a task.
Select the Standard option.
Enter a meaningful name in the Task Name field for the task that corresponds to the data you are collecting.
Select the options you want to configure for the Standard task.
Standard tasks include the following field and tabs.
Field / tabSettingsChoose script field
From a drop down list, select a script for the playbook to run. In the following tabs you can set:
Inputs: Each script has its own set of input arguments (or none). You can set each argument to a specific value (by typing directly on the line under the argument name) or you can click the curly brackets to define a source field to populate the argument.
Outputs: Each script has its own set of output arguments (or none).
Mapping:
Map the output from a playbook task directly to an incident field.
The value for an output key populates the specified field per incident. This is a good alternative to using a task with the
setIncidentcommand.1. In the Mapping tab, click Add custom output mapping.
2. Under Outputs, select the output parameter whose output you want to map. Click the curly brackets to see a list of the output parameters available from the script.
3. Under Field to fill, select the field that you want to populate with the output.
4. Click Save.
Advanced: Includes the following fields.
Using: Choose which integration instance will execute the command, or leave empty to use all integration instances.
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'"
Ignore outputs: If set to true, will not store outputs into the context (besides the extended outputs).
Execution timeout (seconds): Sets the command execution timeout in seconds.
Indicator Extraction mode: Choose when to extract indicators:
None: Do not perform indicator extraction
Inline: Before other playbook tasks
Out of band: While other tasks are running
Mark results as note
Mark results as evidence
Run without a worker
Skip this branch if this script/playbook is unavailable
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.
Details: Includes the following fields.
Tag the result with: Add a tag to the task result. You can use the tag to filter entries in the War Room.
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.
Timers: Includes the following fields.
Timer.start: The trigger for starting to send a message or survey to recipients. You can change this trigger or add a trigger for Timer.stop or Timer.pause. Select the trigger timer field from the drop down.
Add Trigger: You can add other trigger timer fields from the drop down.
On Error: Includes the following fields.
Number of retries: How many times the task should retry running if there is an error. Default is 0.
Retry interval (seconds): How long to wait between retries. Default is 30 seconds.
The maximum retry interval is 800 seconds (13.3 minutes). If you enter a value greater than 800 seconds, the retry interval will be limited to 800 seconds.
Error handling: How the task should behave if there is an error. Options are:
Stop
Continue
Continue on error path(s)
This option configures the task to handle potential errors that may occur when executing the current task's script.
Manual task settings tab
Default assignee: Assign an owner to this task.
Only the assignee can complete the task: Stop the playbook from proceeding until the task assignee completes the task. By default, in addition to the task assignee, the default administrator can also complete the blocked task. You can also block tasks until a user with an external email address completes the task.
Task SLA: Set the SLA in granularity of weeks, days, hours, and minutes.
Set task Reminder at: Set a reminder for the task in granularity of weeks, days, hours, and minutes.
Advanced tab
Quiet Mode: Determines whether this task uses the playbook default setting for 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.
Details tab
Tag the result with: Add a tag to the task result. You can use the tag to filter entries in the War Room.
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.
Timers tab
Timer.start: The trigger for starting to send a message or survey to recipients. You can change this trigger or add a trigger for Timer.stop or Timer.pause. Select the trigger timer field from the drop down.
Add Trigger: You can add other trigger timer fields from the drop down.
Create a conditional task
Conditional tasks are used for determining different paths for your playbook. For example, in a playbook for handling phishing emails, a conditional task can be used to check if an email contains suspicious attachments. If the attachment is identified as malicious, the playbook can automatically quarantine the email; otherwise, it can proceed to manual review by a security analyst.
Conditional task types
You can create different types of conditional tasks.
Built-in: Creates a logical statement using an entity from within the playbook. For example, in an access investigation playbook, you can determine that if the Asset ID of the person whose account was being accessed exists in a VIP list, set the incident severity to High. Otherwise, proceed as normal.
Manual: Creates a conditional task that must be manually resolved. For example, a security analyst is prompted to review and validate a suspicious file. The playbook task might involve instructions for the analyst to analyze the file, determine if it is malicious, and provide feedback or take specific actions based on their assessment.
Ask: Creates a single-question survey communication task. The answer determines how the playbook proceeds. For more details, see Create a communication task.
Choose script: Creates a conditional task based on the result of a script. For example, check if an IP address is internal or external using the
IsIPInRangesscript. When using a script, the inputs and outputs are generated by the automation script.
How to create a conditional task
In a playbook, click + Create Task.
Select the Conditional option.
In the Task Name field, type a meaningful name for the task that corresponds to the data you are collecting.
Select the relevant conditional task option. Some field configurations are required, and some are optional.
Click Save.
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.
Configure script error handling in a playbook
You can determine how the playbook behaves if there are script errors during execution.
When defining a standard task that uses a script or a conditional task that uses an script, you can define how a playbook task continues by selecting one of the following options:
Stop: The playbook stops, if the task errors during execution. For example, if the task requires a manual review, you may want the playbook to stop until completion.
Continue: The playbook continues to execute if the task errors. For example, the playbook task requires EWS, but EWS is not required for the playbook to proceed.
Continue on error path: If a task errors, the playbook continues on an error path.
The error path may be useful if you want to take action on an error, like clean-up, retry, etc. You may also want to handle errors in different ways. For example, in case of a quota expired error you may want to retry in 1 minute, but if you receive an internal error 500, you may want to stop the playbook.
You may want to create a separate path when an analyst manually reviews the incident and research is needed outside Cortex XSOAR. Once an analysis is complete, you can add a task to consider escalating to a customer and, if so, generate a report which can be attached to a ticket system such as Jira or ServiceNow.
Instead of a playbook waiting on manual input, which displays an error state, such as missing an argument in a script, you can add a separate path for these kinds of issues.
Use the GetErrorsFromEntry script (part of the Common Scripts Pack) to check whether the given entry returns an error and returns an error message. For example, when using the script in a playbook, you can fetch the error message from a given task, such as a runtime error. You can then add a step in the playbook flow to send those error messages to the relevant stakeholder through Slack, email, opening a Jira ticket, etc.
When errors are created, they are added to context under task.id.error.
How to set up error handling in your playbook
When adding the connector from this task to the following task, a dialog box appears which enables you to select one of the following paths:
In a playbook, edit or create a new task by clicking +.
If the task library is expanded, click + Create Task.
Select the task type you want to create or edit.
You can set up script error handling when running a script in a Standard task or a Conditional task.
Built-in Conditional tasks have On Error settings for number of retries and retry interval, but not Error Handling.
For new tasks, in the Task Name field, type a meaningful name for the task that corresponds to the data you are collecting.
Click the On Error tab.
In the Number of retries field, type the number of times the task attempts to run before generating an error.
In the Retry Interval (seconds) field, type the wait time between retrying the task.
In the Error Handling field, select one of the following:
Stop
Continue
Continue on error path(s)
Click Save.
When adding the connector from this task to the following task, a dialog box appears which enables you to select one of the following paths:
Standard Path: When adding a task to this path, it executes without any exceptions.
If you select the Standard Path, the task continues on this path and executes without exceptions.
Error Path: When adding a task to this path, it executes where the source task errors during execution.
If you select Error path, if the task errors, the playbook continues with this path.
Last updated
Was this helpful?








