You can run a single task in a workflow on its own, without running the whole workflow. Do this while you build or edit a workflow to check a task's configuration: adjust the input, run the task, inspect the result, and repeat until the task behaves as expected.
Running a single task instead of the whole workflow helps you to:
Running a single task is not a dry run. The task's action runs against real systems with real connections, the same as in a regular workflow execution. For example, a Slack task posts a real message to the channel, a Jira task opens a real ticket, and a configuration task applies its changes to your environment.
A task run is a real execution of one task, not a simulation of the workflow around it. The selected task runs with its configured action and connections, while everything else is substituted: predecessors return their sample results, and task options such as retries and conditions are adjusted or skipped. Because no workflow execution is involved, task runs stay out of your execution history and are recorded separately for auditing.
The selected task runs once, in a real execution:
Only the selected task runs.
Its direct and indirect predecessors don't run; expressions such as result('task_name') instead resolve to their sample results.
Tasks that aren't predecessors of the selected task are ignored.
Sample results are the same values that expression preview shows for result('task_name'), so the preview always matches what the task run uses.
Similarly, a Run JavaScript task that reads predecessor results with the SDK, for example, await result('predecessor_task'), gets these sample results the same way it gets real results in a regular execution.
If the selected task uses the Run workflow action, the sub-workflow runs as a regular, visible workflow execution.
In the execution monitor of the sub-workflow, Trigger by shows Task test of <task name>: <workflow title>.
The entry doesn't link to the parent execution because a task run has no workflow execution that you can open.
The sub-workflow still counts toward its own hourly execution limit.
Task runs are kept apart from the execution history of your workflows. They don't appear in the Executions list because no workflow execution is involved.
Internally, a task run is called a task test, which is reflected in the names of its system events and attributes.
Task tests are recorded as system events in Grail for auditing.
The selected task emits TASK_EXECUTION and ACTION_EXECUTION events with the following attributes:
dt.automation_engine.is_task_test: Set to true.
The attribute is absent on events of regular executions.dt.automation_engine.test_task_execution.trigger.user.id: The user who started the task run.dt.automation_engine.test_task_execution.actor: The actor that the task ran as.Task tests emit no WORKFLOW_EXECUTION event.
For all attributes, see Semantic Dictionary.
To list recent task runs, run the following query, for example, in
Notebooks:
fetch dt.system.events| filter event.kind == "WORKFLOW_EVENT" and event.provider == "AUTOMATION_ENGINE"| filter dt.automation_engine.is_task_test == true| fields timestamp, event.type, dt.automation_engine.workflow.id, dt.automation_engine.task.name, dt.automation_engine.state, dt.automation_engine.test_task_execution.trigger.user.id| sort timestamp desc
Task runs and manual workflow runs share the same per-user rate limit. If you hit it, wait a moment and run the task again.
Running a single task can use other DPS capabilities, the same as a regular workflow execution, for example, Standard Function Calls or DQL queries. For details, see Calculate your consumption of Automation Workflow (DPS).
Save the workflow at least once. For a workflow that has never been saved, Run task is unavailable, and its tooltip asks you to create a workflow draft first. After the first save, unsaved changes in the editor are included when you run a task, so you don't need to save before each run.
Have the permissions to run a task in this workflow. A task run is a real execution, so it requires the same permissions as running the workflow itself:
automation:workflows:write for the type of the workflow, standard or simple.
For details, see Manage workflow permissions.
Access to the workflow: you can't run a task in another user's private workflow.
Be the workflow's actor, or, if the actor is a service user, have the iam:service-users:use permission for that service user.
The actor also needs the permissions required by the task's action, as in a regular execution.
To run a single task:
In
Workflows, open the workflow for editing.
Open the Run task dialog in one of the following ways:
The Run task dialog opens. It shows the task input on the left and the results on the right.
Choose the input to run the task from one of the tabs: Task input, Context, or Evaluated test input.
Optional In Context, adjust the data that expressions in the task input resolve against.
Select Run task either in the Task input or in the Evaluated test input tab.
Inspect the results. Change the input or context and run the task again as often as you need.
From the Apply list, choose one of the options to save your changes, or select Close to discard them. For details, see Apply changes and update the sample result.
The left side of the Run task dialog has three views: Task input, Context, and Evaluated test input.
Task input shows the task's input form, including any expressions, the same way as the task details pane.
When you select Run task, the expressions are resolved against the context before the task runs. If an expression can't be resolved, you see a validation error and the task doesn't run.
Edits that you make here don't update the task input until you apply them.
Evaluated test input shows the task input with all expressions already resolved to values. Use it to override individual values for a one-off task run, without changing the task.
{{ result('my_task') }} reaches the action as plain text and isn't evaluated.Context holds the data that expressions resolve against when you run Task input or resolve Evaluated test input. Edit the context to change the data for all expressions at once. To change individual values, edit Evaluated test input directly.
The context consists of up to three sections:
{{ event()["event.id"] }}.
Available only for workflows with an event trigger.{{ input() }}.
Available only if the workflow has a defined input.{{ result('task_name') }}.
Always available and empty by default.
Add an entry keyed by task name to replace that task's sample result for this run.To edit a Context section:
In Context, select the section that you want to edit.
Select Click to edit.
Edit the JSON object. Each section must be a JSON object.
Select All contexts to return to the overview.
For example, to make the predecessor task fetch_hosts return two hosts for this run, set Task results to:
{"fetch_hosts": {"hosts": ["host-a", "host-b"]}}
If you change your mind, select Reset to restore its default value.
Context changes apply only to the Run task dialog and are never saved to the workflow. If a section contains invalid JSON when you leave it, the section is reset to its default value. You can't run the task from Context; switch to Task input or Evaluated test input to run it.
The right side of the Run task dialog shows the task while it runs and after it finishes:
The results update automatically while the task runs. A task that waits for approval, for example, the Request approval action, stays in the Waiting for approval state until someone responds.
To compare runs, use the Task executions dropdown. The dropdown lists the task runs that you started since you opened the dialog, newest first. Each entry shows a state icon and how long ago the task run started. Select an entry to see its results.
Changes that you make in the Run task dialog aren't written to the task until you apply them. Select Close to discard them.
Apply offers three options:
A sample result can be up to 10,000 characters long. If the latest result is longer, Apply applies your Task input changes only and shows a message that the sample result wasn't saved.
Applying changes updates the workflow in the editor. To keep the changes, save the workflow.
The sample result is what expression preview and autocompletion use for result('task_name') while you edit successor tasks.
It's also what this task returns when you run one of its successors on its own.
Saving a real result as the sample result keeps both accurate.