DAG-type workflow specification¶
A DAG (directed acyclic graph) workflow is a series of tasks that are scheduled to run after their dependencies have finished. See DAG-type workflows result for the result of a DAG workflow.
Specification¶
A DAG-type workflow (element of workflows) has specification
spec_type (string): specification type, must be
dagname, version, description and registration: see Common specification
tasks (array[object]): array of workflow activity tasks to be run during execution, see ScheduleActivityTaskDecisionAttributes
id (string): task ID, must be unique within a workflow execution and without
:,/,|,arnor any control charactertype (object): activity type, with name (str, activity name) and version (str, activity version)
input (object): activity input definition, see Input
heartbeat (int or “NONE”): optional, task heartbeat time-out (seconds), or
"NONE"for unlimitedtimeout (int): optional, task time-out (seconds), or
"None"for unlimitedtask_list (string): optional, task-list to schedule task on
priority (int): optional, task priority
dependencies (array[string]): optional, IDs of task’s dependents
Input¶
There are multiple options when defining activity task input. In the task input specification (aka input-spec), type can have one of the following values:
none: no value will be passed as input, meaning there will be no input key in the poll-for-activity-task response provided to the worker.
input: type: none
constant: the activity will be passed value in the input-spec, which can be any valid type.
input: type: constant value: 42
input: type: constant value: spam: - foo: bar eggs: 42 - null swallow: false
workflow-input: the activity will be passed a portion of the workflow input, according to path in the input-spec (see Basic single-valued JSONPath for its syntax). path can be omitted, defaulting to
"$"(the entire workflow input). Specify default to allow missing values, instead using the value of defaultinput: type: workflow-input
id: foo input: type: workflow-input path: $.foo
input: type: workflow-input path: $.spam[0].eggs.swallow[2]
dependency-result: the activity will be passed a portion of one of its dependencies’ results, with the dependency acitivity task with ID id in the input-spec, according to path in the input-spec (see Basic single-valued JSONPath for its syntax). path can be omitted, defaulting to
"$"(the entire dependency result). Specify default to allow missing values, instead using the value of defaultdependencies: - foo - bar input: type: dependency-result id: bar
dependencies: - foo - bar input: type: dependency-result id: bar path: $.swallow[2]
object: you can have seddy build an object to be passed to the activity, with the value of each key being specified by its own input specification, as defined by items in the input-spec. This can be done recursively.
dependencies: - foo - bar input: type: object items: spam: type: dependency-result id: foo path: $.swallow[2] eggs: type: object items: cheese: type: constant value: null pie: type: workflow-input path: $.spam[0].eggs.swallow[2] gravy: type: dependency-result id: bar ham: type: constant value: 42
Example¶
spec_type: dag
name: spam
version: "1.0"
description: A workflow with spam, spam, eggs and spam.
registration:
active: true
task_timeout: 5
execution_timeout: 3600
task_list: coffee
tasks:
- id: foo
type:
name: spam-foo
version: "0.3"
input:
type: workflow-input
value: $.foo
timeout: 10
task_list: eggs
priority: 1
- id: bar
type:
name: spam-foo
version: "0.4"
input:
type: constant
value: 42
timeout: 10
task_list: eggs
dependencies:
- foo