Jump to: navigation, search

Mistral/DSLv2

< Mistral
Revision as of 21:11, 23 September 2014 by Rakhmerov (talk | contribs) (Workflow Types)

Mistral DSL version 2 specification

Introduction

Current document fully describes Domain Specific Language (DSL) version 2 of Mistral Workflow Service. Since version 1 issued in May 2014 Mistral team completely reworked the language pursuing with the goal in mind to make it easier to understand while more consistent and flexible.

Unlike Mistral DSL v1 this second version of DSL assumes that all entities that Mistral works with like workflows, actions and triggers are completely independent in terms of how they're referenced and accessed through API (and also Python Client API and CLI). Workbooks, the entity that can combine combine workflows/actions/triggers still exist in the language but only for namespacing and convenience purposes. See Workbooks section for more details.

All DSL consists of the following main object(entity) types that will be described in details next:

Workflows

Workflow is the main building block of Mistral DSL, the reason why the project exists. Workflow represents a process that can be described in a various number of ways and that can do some job interesting to the end user. Each workflow consists of tasks (at least one) describing what exact steps should be made during workflow execution.

Workflow Types

In Mistral DSL v2 we introduced multiple workflow types and the structure of each workflow type may vary according to its logic and rules. Currently, Mistral provides two workflow types:

Common Workflow Attributes

TODO

Tasks

TODO

Common Task Attributes

  • action - name of action to run
  • workflow - name of workflow to run
  • input - actual parameters for the task, each value can be either some number, string etc, or YAQL expression to retrieve value from task context

Direct Workflow

TODO

Attributes
  • tasks - list of tasks in this workflow, each task represents a computational step in the workflow.
Direct Workflow Task Attributes

TODO

  • on-success - task which will be scheduled on execution after current task has finished with state 'SUCCESS'
  • on-error - task which will be scheduled on execution after current task has finished with state 'ERROR'
  • on-finish - task which will be scheduled on execution after current task has finished
Direct Workflow YAML example

TODO

Reverse Workflow

Attributes
  • tasks - list of tasks in this workflow, each task represents a computational step in the workflow.
Reverse Workflow Task Attributes

TODO

  • requires - list of tasks which should be execute before this tasks, or list of task names as a keys and condition as a value, this is optional parameter
Reverse Workflow YAML example

TODO

Actions

TODO: Mention system and ad-hoc actions

System Actions

TODO

Ad-hoc actions

TODO

Attributes
  • name - action name (string without space, mandatory attribute).
  • base - name of base action that this action is built on top of.
  • base-input - dictionary whose structure is defined by action class. For example, for 'std.http' action it contains 'url', 'method', 'body' and 'headers' according to HTTP protocol specification.
  • input - list containing parameter names which should or could be specified in task. This attribute is optional and used only for documenting purposes.
  • output - any data structure defining how to transform the output of base action into the output of this action. I can optionally have YAQL expressions to access properties of base action output. (See more about YAQL at https://pypi.python.org/pypi/yaql/0.3)
YAML example

TODO

Triggers [coming in version 0.2.0]

NOTE: Triggers are not yet implemented as part of version 0.1.0, they will go into 0.2.0

Using triggers it is possible to run workflows according to specific rules: periodically setting a cron (http://en.wikipedia.org/wiki/Cron) pattern or on external events like ceilometer alarm.

Attributes

TODO

YAML example

TODO

Workbooks

TODO

Attributes

TODO

Workbook YAML example

TODO