REST API V2

This API describes the ways of interacting with Mistral service via HTTP protocol using Representational State Transfer concept (ReST).

Basics

Media types

Currently this API relies on JSON to represent states of REST resources.

Error states

The common HTTP Response Status Codes (https://github.com/for-GET/know-your-http-well/blob/master/status-codes.md) are used.

Application root [/]

Application Root provides links to all possible API methods for Mistral. URLs for other resources described below are relative to Application Root.

API v2 root [/v2/]

All API v2 URLs are relative to API v2 root.

Workbooks

type Workbook

Workbook resource.

Data samples:

Json
{
    "created_at": "1970-01-01T00:00:00.000000",
    "definition": "HERE GOESWORKBOOK DEFINITION IN MISTRAL DSL v2",
    "id": "123e4567-e89b-12d3-a456-426655440000",
    "name": "book",
    "namespace": "",
    "project_id": "a7eb669e9819420ea4bd1453e672c0a7",
    "scope": "private",
    "tags": [
        "large",
        "expensive"
    ],
    "updated_at": "1970-01-01T00:00:00.000000"
}
definition
Type:

str

workbook definition in Mistral v2 DSL

scope
Type:

Enum(private, public)

‘private’ or ‘public’

name is immutable. tags is a list of values associated with a workbook that a user can use to group workbooks by some criteria (deployment workbooks, Big Data processing workbooks etc.). Note that name and tags get inferred from workbook definition when Mistral service receives a POST request. So they can’t be changed in another way.

type Workbooks

A collection of Workbooks.

Data samples:

Json
{
    "workbooks": [
        {
            "created_at": "1970-01-01T00:00:00.000000",
            "definition": "HERE GOESWORKBOOK DEFINITION IN MISTRAL DSL v2",
            "id": "123e4567-e89b-12d3-a456-426655440000",
            "name": "book",
            "namespace": "",
            "project_id": "a7eb669e9819420ea4bd1453e672c0a7",
            "scope": "private",
            "tags": [
                "large",
                "expensive"
            ],
            "updated_at": "1970-01-01T00:00:00.000000"
        }
    ]
}
next
Type:

str

A link to retrieve the next subset of the resource list

GET /v2/workbooks

Return a list of workbooks.

Parameters:
  • marker (uuid) – Optional. Pagination marker for large data sets.

  • limit (int) – Optional. Maximum number of resources to return in a single result. Default value is None for backward compatibility.

  • sort_keys (uniquelist) – Optional. Columns to sort results by. Default: created_at.

  • sort_dirs (list) – Optional. Directions to sort corresponding to sort_keys, “asc” or “desc” can be chosen. Default: asc.

  • fields (uniquelist) – Optional. A specified list of fields of the resource to be returned. ‘id’ will be included automatically in fields if it’s not provided, since it will be used when constructing ‘next’ link.

  • name (str) – Optional. Keep only resources with a specific name.

  • definition (str) – Optional. Keep only resources with a specific definition.

  • tags (str) – Optional. Keep only resources containing specific tags.

  • scope (Enum(private, public)) – Optional. Keep only resources with a specific scope.

  • created_at (str) – Optional. Keep only resources created at a specific time and date.

  • updated_at (str) – Optional. Keep only resources with specific latest update time and date.

  • namespace (str) – Optional. Keep only resources with specific namespace.

Return type:

Workbooks

GET /v2/workbooks

Return the named workbook.

Parameters:
  • name (str) – Name of workbook to retrieve.

  • namespace (str) – Optional. Namespace of workbook to retrieve.

  • fields (uniquelist) – Optional. A specified list of fields of the resource to be returned. ‘id’ will be included automatically in fields if it’s not provided.

Return type:

Workbook

POST /v2/workbooks

Create a new workbook.

Parameters:
  • namespace – Optional. The namespace to create the workbook in. Workbooks with the same name can be added to a given project if they are in two different namespaces.

PUT /v2/workbooks

Update a workbook.

Parameters:
  • namespace – Optional. Namespace of workbook to update.

DELETE /v2/workbooks

Delete the named workbook.

Parameters:
  • name (str) – Name of workbook to delete.

  • namespace (str) – Optional. Namespace of workbook to delete.

Workflows

type Workflow

Workflow resource.

Data samples:

Json
{
    "created_at": "1970-01-01T00:00:00.000000",
    "definition": "HERE GOESWORKFLOW DEFINITION IN MISTRAL DSL v2",
    "id": "123e4567-e89b-12d3-a456-426655440000",
    "input": "param1, param2",
    "interface": "{\"input\": [\"param1\", {\"param2\": 2}], \"output\": []}",
    "name": "flow",
    "namespace": "",
    "project_id": "a7eb669e9819420ea4bd1453e672c0a7",
    "scope": "private",
    "tags": [
        "large",
        "expensive"
    ],
    "updated_at": "1970-01-01T00:00:00.000000"
}
checksum
Type:

str

workflow text written in Mistral v2 language

interface
Type:

json

input and output of the workflow

scope
Type:

Enum(private, public)

‘private’ or ‘public’

name is immutable. tags is a list of values associated with a workflow that a user can use to group workflows by some criteria. Note that name and tags get inferred from workflow definition when Mistral service receives a POST request. So they can’t be changed in another way.

type Workflows

A collection of workflows.

Data samples:

Json
{
    "next": "http://localhost:8989/v2/workflows?sort_keys=id,name&sort_dirs=asc,desc&limit=10&marker=123e4567-e89b-12d3-a456-426655440000",
    "workflows": [
        {
            "created_at": "1970-01-01T00:00:00.000000",
            "definition": "HERE GOESWORKFLOW DEFINITION IN MISTRAL DSL v2",
            "id": "123e4567-e89b-12d3-a456-426655440000",
            "input": "param1, param2",
            "interface": "{\"input\": [\"param1\", {\"param2\": 2}], \"output\": []}",
            "name": "flow",
            "namespace": "",
            "project_id": "a7eb669e9819420ea4bd1453e672c0a7",
            "scope": "private",
            "tags": [
                "large",
                "expensive"
            ],
            "updated_at": "1970-01-01T00:00:00.000000"
        }
    ]
}
next
Type:

str

A link to retrieve the next subset of the resource list

GET /v2/workflows

Return a list of workflows.

Parameters:
  • marker (uuid) – Optional. Pagination marker for large data sets.

  • limit (int) – Optional. Maximum number of resources to return in a single result. Default value is None for backward compatibility.

  • sort_keys (uniquelist) – Optional. Columns to sort results by. Default: created_at.

  • sort_dirs (list) – Optional. Directions to sort corresponding to sort_keys, “asc” or “desc” can be chosen. Default: asc.

  • fields (uniquelist) – Optional. A specified list of fields of the resource to be returned. ‘id’ will be included automatically in fields if it’s not provided, since it will be used when constructing ‘next’ link.

  • name (str) – Optional. Keep only resources with a specific name.

  • namespace (str) – Optional. Keep only resources with a specific namespace

  • input (str) – Optional. Keep only resources with a specific input.

  • definition (str) – Optional. Keep only resources with a specific definition.

  • tags (str) – Optional. Keep only resources containing specific tags.

  • scope (Enum(private, public)) – Optional. Keep only resources with a specific scope.

  • project_id (uuid) – Optional. The same as the requester project_id or different if the scope is public.

  • created_at (str) – Optional. Keep only resources created at a specific time and date.

  • updated_at (str) – Optional. Keep only resources with specific latest update time and date.

  • all_projects (bool) – Optional. Get resources of all projects.

Return type:

Workflows

GET /v2/workflows

Return the named workflow.

Parameters:
  • identifier (str) – Name or UUID of the workflow to retrieve.

  • namespace (str) – Optional. Namespace of the workflow to retrieve.

  • fields (uniquelist) – Optional. A specified list of fields of the resource to be returned. ‘id’ will be included automatically in fields if it’s not provided.

Return type:

Workflow

POST /v2/workflows

Create a new workflow.

Parameters:
  • namespace – Optional. The namespace to create the workflow in. Workflows with the same name can be added to a given project if they are in two different namespaces.

The text is allowed to have definitions of multiple workflows. In such case, they all will be created.

PUT /v2/workflows

Update one or more workflows.

Parameters:
  • identifier – Optional. If provided, it’s UUID of a workflow. Only one workflow can be updated with identifier param.

  • namespace – Optional. If provided, it’s the namespace of the workflow/workflows. Currently, namespace cannot be changed.

The text is allowed to have definitions of multiple workflows. In such case, they all will be updated.

DELETE /v2/workflows

Delete a workflow.

Parameters:
  • identifier (str) – Name or ID of workflow to delete.

  • namespace (str) – Optional. Namespace of the workflow to delete.

Actions

type Action

Action resource.

NOTE: name is immutable. Note that name and description get inferred from action definition when Mistral service receives a POST request. So they can’t be changed in another way.

Data samples:

Json
{
    "created_at": "1970-01-01T00:00:00.000000",
    "definition": "HERE GOES ACTION DEFINITION IN MISTRAL DSL v2",
    "id": "123e4567-e89b-12d3-a456-426655440000",
    "name": "flow",
    "namespace": "",
    "project_id": "a7eb669e9819420ea4bd1453e672c0a7",
    "scope": "private",
    "tags": [
        "large",
        "expensive"
    ],
    "updated_at": "1970-01-01T00:00:00.000000"
}
type Actions

A collection of Actions.

Data samples:

Json
{
    "actions": [
        {
            "created_at": "1970-01-01T00:00:00.000000",
            "definition": "HERE GOES ACTION DEFINITION IN MISTRAL DSL v2",
            "id": "123e4567-e89b-12d3-a456-426655440000",
            "name": "flow",
            "namespace": "",
            "project_id": "a7eb669e9819420ea4bd1453e672c0a7",
            "scope": "private",
            "tags": [
                "large",
                "expensive"
            ],
            "updated_at": "1970-01-01T00:00:00.000000"
        }
    ],
    "next": "http://localhost:8989/v2/actions?sort_keys=id,name&sort_dirs=asc,desc&limit=10&marker=123e4567-e89b-12d3-a456-426655440000"
}
next
Type:

str

A link to retrieve the next subset of the resource list

GET /v2/actions

Return all actions.

Parameters:
  • marker (str) – Optional. Pagination marker for large data sets.

  • limit (int) – Optional. Maximum number of resources to return in a single result. Default value is None for backward compatibility.

  • sort_keys (uniquelist) – Optional. Columns to sort results by. Default: name.

  • sort_dirs (list) – Optional. Directions to sort corresponding to sort_keys, “asc” or “desc” can be chosen. Default: asc.

  • fields (uniquelist) – Optional. A specified list of fields of the resource to be returned. ‘id’ will be included automatically in fields if it’s not provided, since it will be used when constructing ‘next’ link.

  • name (str) – Optional. Keep only resources with a specific name.

  • scope (Enum(private, public)) – Optional. Keep only resources with a specific scope.

  • definition (str) – Optional. Keep only resources with a specific definition.

  • is_system (str) – Optional. Keep only system actions or ad-hoc actions (if False).

  • input (str) – Optional. Keep only resources with a specific input.

  • description (str) – Optional. Keep only resources with a specific description.

  • tags (str) – Optional. Keep only resources containing specific tags.

  • created_at (str) – Optional. Keep only resources created at a specific time and date.

  • updated_at (str) – Optional. Keep only resources with specific latest update time and date.

  • namespace (str) – Optional. The namespace of the action.

Return type:

Actions

GET /v2/actions

Return the named action.

Parameters:
  • identifier (str) – ID or name of the Action to get.

  • namespace (str) – The namespace of the action.

  • fields – Optional. A specified list of fields of the resource to be returned. ‘id’ will be included automatically in fields if it’s not provided.

Return type:

Action

POST /v2/actions

Create a new action.

Parameters:
  • namespace – Optional. The namespace to create the ad-hoc action in. actions with the same name can be added to a given project if they are in two different namespaces. (default namespace is ‘’)

NOTE: This text is allowed to have definitions

of multiple actions. In this case they all will be created.

PUT /v2/actions

Update one or more actions.

Parameters:
  • identifier – Optional. If provided, it’s UUID or name of an action. Only one action can be updated with identifier param.

  • namespace – Optional. If provided, it’s the namespace that the action is under.

NOTE: This text is allowed to have definitions

of multiple actions. In this case they all will be updated.

DELETE /v2/actions

Delete the named action.

Parameters:
  • identifier (str) – Name or UUID of the action to delete.

  • namespace (str) – The namespace of which the action is in.

Executions

type Execution

Execution resource.

Data samples:

Json
{
    "created_at": "1970-01-01T00:00:00.000000",
    "description": "this is the first execution.",
    "id": "123e4567-e89b-12d3-a456-426655440000",
    "input": "{}",
    "output": "{}",
    "params": "{\"env\": {\"k1\": \"abc\", \"k2\": 123}, \"notify\": [{\"type\": \"webhook\", \"url\": \"http://endpoint/of/webhook\", \"headers\": {\"Content-Type\": \"application/json\", \"X-Auth-Token\": \"123456789\"}}, {\"type\": \"queue\", \"topic\": \"failover_queue\", \"backend\": \"rabbitmq\", \"host\": \"127.0.0.1\", \"port\": 5432}]}",
    "project_id": "40a908dbddfe48ad80a87fb30fa70a03",
    "published_global": "{\"key\": \"value\"}",
    "state": "SUCCESS",
    "tags": [
        "simple",
        "amazing"
    ],
    "updated_at": "1970-01-01T00:00:00.000000",
    "workflow_id": "123e4567-e89b-12d3-a456-426655441111",
    "workflow_name": "flow",
    "workflow_namespace": "some_namespace"
}
description
Type:

str

description of workflow execution

id
Type:

str

execution ID. It is immutable and auto assigned or determined by the API

input
Type:

json

input is a JSON structure containing workflow input values

output
Type:

json

output is a workflow output

params
Type:

json

‘params’ define workflow type specific parameters. Specific parameters are: ‘task_name’ - the name of the target task. Only for reverse workflows. ‘env’ - A string value containing the name of the stored environment object or a dictionary with the environment variables used during workflow execution and accessible as ‘env()’ from within expressions (YAQL or Jinja) defined in the workflow text. ‘evaluate_env’ - If present, controls whether or not Mistral should recursively find and evaluate all expressions (YAQL or Jinja) within the specified environment (via ‘env’ parameter). ‘True’ - evaluate all expressions recursively in the environment structure. ‘False’ - don’t evaluate expressions. ‘True’ by default.

root_execution_id
Type:

str

reference to the root execution

source_execution_id
Type:

str

reference to a workflow execution id which will signal the api to perform a lookup of a current workflow_execution and create a replica based on that workflow inputs and parameters

state
Type:

str

state can be one of: IDLE, RUNNING, SUCCESS, ERROR, PAUSED

state_info
Type:

str

an optional state information string

tags
Type:

list(str)

tags of workflow execution

task_execution_id
Type:

str

reference to the parent task execution

workflow_id
Type:

str

workflow ID

workflow_name
Type:

str

workflow name

workflow_namespace
Type:

str

Workflow namespace. The workflow namespace is also saved under params and passed to all sub-workflow executions. When looking for the next sub-workflow to run, The correct workflow will be found by name and namespace, where the namespace can be the workflow namespace or the default namespace. Workflows in the same namespace as the top workflow will be given a higher priority.

type Executions

A collection of Execution resources.

Data samples:

Json
{
    "executions": [
        {
            "created_at": "1970-01-01T00:00:00.000000",
            "description": "this is the first execution.",
            "id": "123e4567-e89b-12d3-a456-426655440000",
            "input": "{}",
            "output": "{}",
            "params": "{\"env\": {\"k1\": \"abc\", \"k2\": 123}, \"notify\": [{\"type\": \"webhook\", \"url\": \"http://endpoint/of/webhook\", \"headers\": {\"Content-Type\": \"application/json\", \"X-Auth-Token\": \"123456789\"}}, {\"type\": \"queue\", \"topic\": \"failover_queue\", \"backend\": \"rabbitmq\", \"host\": \"127.0.0.1\", \"port\": 5432}]}",
            "project_id": "40a908dbddfe48ad80a87fb30fa70a03",
            "published_global": "{\"key\": \"value\"}",
            "state": "SUCCESS",
            "tags": [
                "simple",
                "amazing"
            ],
            "updated_at": "1970-01-01T00:00:00.000000",
            "workflow_id": "123e4567-e89b-12d3-a456-426655441111",
            "workflow_name": "flow",
            "workflow_namespace": "some_namespace"
        }
    ],
    "next": "http://localhost:8989/v2/executions?sort_keys=id,workflow_name&sort_dirs=asc,desc&limit=10&marker=123e4567-e89b-12d3-a456-426655440000"
}
next
Type:

str

A link to retrieve the next subset of the resource list

GET /v2/executions

Return all Executions.

Parameters:
  • marker (uuid) – Optional. Pagination marker for large data sets.

  • limit (int) – Optional. Maximum number of resources to return in a single result. Default value is None for backward compatibility.

  • sort_keys (uniquelist) – Optional. Columns to sort results by. Default: created_at, which is backward compatible.

  • sort_dirs (list) – Optional. Directions to sort corresponding to sort_keys, “asc” or “desc” can be chosen. Default: desc. The length of sort_dirs can be equal or less than that of sort_keys.

  • fields (uniquelist) – Optional. A specified list of fields of the resource to be returned. ‘id’ will be included automatically in fields if it’s not provided, since it will be used when constructing ‘next’ link.

  • workflow_name (str) – Optional. Keep only resources with a specific workflow name.

  • workflow_id (uuid) – Optional. Keep only resources with a specific workflow ID.

  • description (str) – Optional. Keep only resources with a specific description.

  • tags (uniquelist) – Optional. Keep only resources containing specific tags.

  • params (json) – Optional. Keep only resources with specific parameters.

  • task_execution_id (uuid) – Optional. Keep only resources with a specific task execution ID.

  • root_execution_id (uuid) – Optional. Keep only resources with a specific root execution ID.

  • state (Enum(IDLE, RUNNING, SUCCESS, ERROR, PAUSED, CANCELLED)) – Optional. Keep only resources with a specific state.

  • state_info (str) – Optional. Keep only resources with specific state information.

  • input (json) – Optional. Keep only resources with a specific input.

  • output (json) – Optional. Keep only resources with a specific output.

  • created_at (str) – Optional. Keep only resources created at a specific time and date.

  • updated_at (str) – Optional. Keep only resources with specific latest update time and date.

  • include_output (bool) – Optional. Include the output for all executions in the list.

  • project_id (uuid) – Optional. Only get executions belong to the project. Admin required.

  • all_projects (bool) – Optional. Get resources of all projects. Admin required.

  • nulls (list) – Optional. The names of the columns with null value in the query.

Return type:

Executions

GET /v2/executions

Return the specified Execution.

Parameters:
  • id (str) – UUID of execution to retrieve.

  • fields (uniquelist) – Optional. A specified list of fields of the resource to be returned. ‘id’ will be included automatically in fields if it’s not provided.

Return type:

Execution

POST /v2/executions

Create a new Execution.

Parameters:
  • wf_ex (Execution) – Execution object with input content.

Return type:

Execution

PUT /v2/executions

Update the specified workflow execution.

Parameters:
  • id (str) – UUID of execution to update.

  • wf_ex (Execution) – Execution object.

Return type:

Execution

DELETE /v2/executions

Delete the specified Execution.

Parameters:
  • id (str) – UUID of execution to delete.

  • force (bool) – Optional. Force the deletion of unfinished executions. Default: false. While the api is backward compatible the behaviour is not the same. The new default is the safer option

Tasks

When a workflow starts Mistral creates an execution. It in turn consists of a set of tasks. So Task is an instance of a task described in a Workflow that belongs to a particular execution.

type Task

Task resource.

Data samples:

Json
{
    "created_at": "1970-01-01T00:00:00.000000",
    "id": "123e4567-e89b-12d3-a456-426655440000",
    "name": "task",
    "processed": true,
    "project_id": "40a908dbddfe48ad80a87fb30fa70a03",
    "published": "{\"key\": \"value\"}",
    "published_global": "{\"key\": \"value\"}",
    "reset": true,
    "result": "task result",
    "runtime_context": "{\"triggered_by\": [{\"task_id\": \"123-123-123\", \"event\": \"on-success\"}]}",
    "state": "SUCCESS",
    "tags": [
        "long",
        "security"
    ],
    "updated_at": "1970-01-01T00:00:00.000000",
    "workflow_execution_id": "123e4567-e89b-12d3-a456-426655440000",
    "workflow_id": "123e4567-e89b-12d3-a456-426655441111",
    "workflow_name": "flow"
}
state
Type:

str

state can take one of the following values: IDLE, RUNNING, SUCCESS, ERROR, DELAYED

state_info
Type:

str

an optional state information string

type Tasks

A collection of tasks.

Data samples:

Json
{
    "tasks": [
        {
            "created_at": "1970-01-01T00:00:00.000000",
            "id": "123e4567-e89b-12d3-a456-426655440000",
            "name": "task",
            "processed": true,
            "project_id": "40a908dbddfe48ad80a87fb30fa70a03",
            "published": "{\"key\": \"value\"}",
            "published_global": "{\"key\": \"value\"}",
            "reset": true,
            "result": "task result",
            "runtime_context": "{\"triggered_by\": [{\"task_id\": \"123-123-123\", \"event\": \"on-success\"}]}",
            "state": "SUCCESS",
            "tags": [
                "long",
                "security"
            ],
            "updated_at": "1970-01-01T00:00:00.000000",
            "workflow_execution_id": "123e4567-e89b-12d3-a456-426655440000",
            "workflow_id": "123e4567-e89b-12d3-a456-426655441111",
            "workflow_name": "flow"
        }
    ]
}
next
Type:

str

A link to retrieve the next subset of the resource list

GET /v2/tasks

Return all tasks.

Where project_id is the same as the requester or project_id is different but the scope is public.

Parameters:
  • marker (uuid) – Optional. Pagination marker for large data sets.

  • limit (int) – Optional. Maximum number of resources to return in a single result. Default value is None for backward compatibility.

  • sort_keys (uniquelist) – Optional. Columns to sort results by. Default: created_at, which is backward compatible.

  • sort_dirs (list) – Optional. Directions to sort corresponding to sort_keys, “asc” or “desc” can be chosen. Default: desc. The length of sort_dirs can be equal or less than that of sort_keys.

  • fields (uniquelist) – Optional. A specified list of fields of the resource to be returned. ‘id’ will be included automatically in fields if it’s not provided, since it will be used when constructing ‘next’ link.

  • name (str) – Optional. Keep only resources with a specific name.

  • workflow_name (str) – Optional. Keep only resources with a specific workflow name.

  • workflow_id (uuid) – Optional. Keep only resources with a specific workflow ID.

  • workflow_execution_id (uuid) – Optional. Keep only resources with a specific workflow execution ID.

  • state (Enum(IDLE, RUNNING, SUCCESS, ERROR, DELAYED)) – Optional. Keep only resources with a specific state.

  • state_info (str) – Optional. Keep only resources with specific state information.

  • result (str) – Optional. Keep only resources with a specific result.

  • published (json) – Optional. Keep only resources with specific published content.

  • processed (bool) – Optional. Keep only resources which have been processed or not.

  • reset (bool) – Optional. Keep only resources which have been reset or not.

  • env (json) – Optional. Keep only resources with a specific environment.

  • created_at (str) – Optional. Keep only resources created at a specific time and date.

  • updated_at (str) – Optional. Keep only resources with specific latest update time and date.

Return type:

Tasks

GET /v2/tasks

Return the specified task.

Parameters:
  • id (str) – UUID of task to retrieve

  • fields (uniquelist) – Optional. A specified list of fields of the resource to be returned. ‘id’ will be included automatically in fields if it’s not provided.

Return type:

Task

PUT /v2/tasks

Update the specified task execution.

Parameters:
  • id (str) – Task execution ID.

  • task (Task) – Task execution object.

Return type:

Task

GET /v2/executions

Return all tasks within the execution.

Where project_id is the same as the requester or project_id is different but the scope is public.

Parameters:
  • marker (uuid) – Optional. Pagination marker for large data sets.

  • limit (int) – Optional. Maximum number of resources to return in a single result. Default value is None for backward compatibility.

  • sort_keys (uniquelist) – Optional. Columns to sort results by. Default: created_at, which is backward compatible.

  • sort_dirs (list) – Optional. Directions to sort corresponding to sort_keys, “asc” or “desc” can be chosen. Default: desc. The length of sort_dirs can be equal or less than that of sort_keys.

  • fields (uniquelist) – Optional. A specified list of fields of the resource to be returned. ‘id’ will be included automatically in fields if it’s not provided, since it will be used when constructing ‘next’ link.

  • name (str) – Optional. Keep only resources with a specific name.

  • workflow_name (str) – Optional. Keep only resources with a specific workflow name.

  • workflow_id (uuid) – Optional. Keep only resources with a specific workflow ID.

  • workflow_execution_id (uuid) – Optional. Keep only resources with a specific workflow execution ID.

  • tags (uniquelist) – Optional. Keep only resources containing specific tags.

  • state (Enum(IDLE, RUNNING, SUCCESS, ERROR, DELAYED)) – Optional. Keep only resources with a specific state.

  • state_info (str) – Optional. Keep only resources with specific state information.

  • result (str) – Optional. Keep only resources with a specific result.

  • published (json) – Optional. Keep only resources with specific published content.

  • processed (bool) – Optional. Keep only resources which have been processed or not.

  • reset (bool) – Optional. Keep only resources which have been reset or not.

  • env (json) – Optional. Keep only resources with a specific environment.

  • created_at (str) – Optional. Keep only resources created at a specific time and date.

  • updated_at (str) – Optional. Keep only resources with specific latest update time and date.

Return type:

Tasks

Action Executions

When a Task starts Mistral creates a set of Action Executions. So Action Execution is an instance of an action call described in a Workflow Task that belongs to a particular execution.

type ActionExecution

ActionExecution resource.

Data samples:

Json
{
    "accepted": true,
    "created_at": "1970-01-01T00:00:00.000000",
    "description": "My running action",
    "id": "123e4567-e89b-12d3-a456-426655440000",
    "input": "{\"first_name\": \"John\", \"last_name\": \"Doe\"}",
    "name": "std.echo",
    "output": "{\"some_output\": \"Hello, John Doe!\"}",
    "params": "{\"save_result\": true, \"run_sync\": false}",
    "project_id": "40a908dbddfe48ad80a87fb30fa70a03",
    "state": "SUCCESS",
    "state_info": "SUCCESS",
    "tags": [
        "foo",
        "fee"
    ],
    "task_execution_id": "343e45623-e89b-12d3-a456-426655440090",
    "task_name": "task1",
    "updated_at": "1970-01-01T00:00:00.000000",
    "workflow_name": "flow"
}
type ActionExecutions

A collection of action_executions.

Data samples:

Json
{
    "action_executions": [
        {
            "accepted": true,
            "created_at": "1970-01-01T00:00:00.000000",
            "description": "My running action",
            "id": "123e4567-e89b-12d3-a456-426655440000",
            "input": "{\"first_name\": \"John\", \"last_name\": \"Doe\"}",
            "name": "std.echo",
            "output": "{\"some_output\": \"Hello, John Doe!\"}",
            "params": "{\"save_result\": true, \"run_sync\": false}",
            "project_id": "40a908dbddfe48ad80a87fb30fa70a03",
            "state": "SUCCESS",
            "state_info": "SUCCESS",
            "tags": [
                "foo",
                "fee"
            ],
            "task_execution_id": "343e45623-e89b-12d3-a456-426655440090",
            "task_name": "task1",
            "updated_at": "1970-01-01T00:00:00.000000",
            "workflow_name": "flow"
        }
    ]
}
next
Type:

str

A link to retrieve the next subset of the resource list

GET /v2/action_executions

Return all tasks within the execution.

Where project_id is the same as the requester or project_id is different but the scope is public.

Parameters:
  • marker (uuid) – Optional. Pagination marker for large data sets.

  • limit (int) – Optional. Maximum number of resources to return in a single result. Default value is None for backward compatibility.

  • sort_keys (uniquelist) – Optional. Columns to sort results by. Default: created_at, which is backward compatible.

  • sort_dirs (list) – Optional. Directions to sort corresponding to sort_keys, “asc” or “desc” can be chosen. Default: desc. The length of sort_dirs can be equal or less than that of sort_keys.

  • fields (uniquelist) – Optional. A specified list of fields of the resource to be returned. ‘id’ will be included automatically in fields if it’s not provided, since it will be used when constructing ‘next’ link.

  • name (str) – Optional. Keep only resources with a specific name.

  • workflow_name (str) – Optional. Keep only resources with a specific workflow name.

  • task_name (str) – Optional. Keep only resources with a specific task name.

  • task_execution_id (uuid) – Optional. Keep only resources within a specific task execution.

  • state (str) – Optional. Keep only resources with a specific state.

  • state_info (str) – Optional. Keep only resources with specific state information.

  • accepted (bool) – Optional. Keep only resources which have been accepted or not.

  • input (json) – Optional. Keep only resources with a specific input.

  • output (json) – Optional. Keep only resources with a specific output.

  • params (json) – Optional. Keep only resources with specific parameters.

  • description (str) – Optional. Keep only resources with a specific description.

  • tags (str) – Optional. Keep only resources containing specific tags.

  • created_at (str) – Optional. Keep only resources created at a specific time and date.

  • updated_at (str) – Optional. Keep only resources with specific latest update time and date.

  • include_output (bool) – Optional. Include the output for all executions in the list

Return type:

ActionExecutions

GET /v2/action_executions

Return the specified action_execution.

Parameters:
  • id (str) – UUID of action execution to retrieve

  • fields (uniquelist) – Optional. A specified list of fields of the resource to be returned. ‘id’ will be included automatically in fields if it’s not provided.

Return type:

ActionExecution

POST /v2/action_executions

Create new action_execution.

Parameters:
Return type:

ActionExecution

PUT /v2/action_executions

Update the specified action_execution.

Parameters:
  • id (str) – UUID of action execution to update

  • action_ex (ActionExecution) – Action execution for update

Return type:

ActionExecution

DELETE /v2/action_executions

Delete the specified action_execution.

Parameters:
  • id (str) – UUID of action execution to delete

GET /v2/tasks

Return all tasks within the execution.

Where project_id is the same as the requester or project_id is different but the scope is public.

Parameters:
  • task_execution_id (uuid) – Keep only resources within a specific task execution.

  • marker (uuid) – Optional. Pagination marker for large data sets.

  • limit (int) – Optional. Maximum number of resources to return in a single result. Default value is None for backward compatibility.

  • sort_keys (uniquelist) – Optional. Columns to sort results by. Default: created_at, which is backward compatible.

  • sort_dirs (list) – Optional. Directions to sort corresponding to sort_keys, “asc” or “desc” can be chosen. Default: desc. The length of sort_dirs can be equal or less than that of sort_keys.

  • fields (uniquelist) – Optional. A specified list of fields of the resource to be returned. ‘id’ will be included automatically in fields if it’s not provided, since it will be used when constructing ‘next’ link.

  • name (uniquelist) – Optional. Keep only resources with a specific name.

  • workflow_name (str) – Optional. Keep only resources with a specific workflow name.

  • task_name (str) – Optional. Keep only resources with a specific task name.

  • state (str) – Optional. Keep only resources with a specific state.

  • state_info (str) – Optional. Keep only resources with specific state information.

  • accepted (bool) – Optional. Keep only resources which have been accepted or not.

  • input (json) – Optional. Keep only resources with a specific input.

  • output (json) – Optional. Keep only resources with a specific output.

  • params (json) – Optional. Keep only resources with specific parameters.

  • description (str) – Optional. Keep only resources with a specific description.

  • tags (str) – Optional. Keep only resources containing specific tags.

  • created_at (str) – Optional. Keep only resources created at a specific time and date.

  • updated_at (str) – Optional. Keep only resources with specific latest update time and date.

  • include_output (bool) – Optional. Include the output for all executions in the list

Return type:

ActionExecutions

GET /v2/tasks

Return the specified action_execution.

Parameters:
  • task_execution_id (str) – Task execution UUID

  • action_ex_id (str) – Action execution UUID

  • fields (uniquelist) – Optional. A specified list of fields of the resource to be returned. ‘id’ will be included automatically in fields if it’s not provided.

Return type:

ActionExecution

Cron Triggers

Cron trigger is an object that allows to run Mistral workflows according to a time pattern (Unix crontab patterns format). Once a trigger is created it will run a specified workflow according to its properties: pattern, first_execution_time and remaining_executions.

type CronTrigger

CronTrigger resource.

Data samples:

Json
{
    "created_at": "1970-01-01T00:00:00.000000",
    "id": "123e4567-e89b-12d3-a456-426655440000",
    "name": "my_trigger",
    "pattern": "* * * * *",
    "project_id": "40a908dbddfe48ad80a87fb30fa70a03",
    "remaining_executions": 42,
    "scope": "private",
    "updated_at": "1970-01-01T00:00:00.000000",
    "workflow_id": "123e4567-e89b-12d3-a456-426655441111",
    "workflow_input": "{}",
    "workflow_name": "my_wf",
    "workflow_params": "{}"
}
type CronTriggers

A collection of cron triggers.

Data samples:

Json
{
    "cron_triggers": [
        {
            "created_at": "1970-01-01T00:00:00.000000",
            "id": "123e4567-e89b-12d3-a456-426655440000",
            "name": "my_trigger",
            "pattern": "* * * * *",
            "project_id": "40a908dbddfe48ad80a87fb30fa70a03",
            "remaining_executions": 42,
            "scope": "private",
            "updated_at": "1970-01-01T00:00:00.000000",
            "workflow_id": "123e4567-e89b-12d3-a456-426655441111",
            "workflow_input": "{}",
            "workflow_name": "my_wf",
            "workflow_params": "{}"
        }
    ]
}
next
Type:

str

A link to retrieve the next subset of the resource list

GET /v2/cron_triggers

Return all cron triggers.

Parameters:
  • marker (uuid) – Optional. Pagination marker for large data sets.

  • limit (int) – Optional. Maximum number of resources to return in a single result. Default value is None for backward compatibility.

  • sort_keys (uniquelist) – Optional. Columns to sort results by. Default: created_at, which is backward compatible.

  • sort_dirs (list) – Optional. Directions to sort corresponding to sort_keys, “asc” or “desc” can be chosen. Default: desc. The length of sort_dirs can be equal or less than that of sort_keys.

  • fields (uniquelist) – Optional. A specified list of fields of the resource to be returned. ‘id’ will be included automatically in fields if it’s not provided, since it will be used when constructing ‘next’ link.

  • name (str) – Optional. Keep only resources with a specific name.

  • workflow_name (str) – Optional. Keep only resources with a specific workflow name.

  • workflow_id (uuid) – Optional. Keep only resources with a specific workflow ID.

  • workflow_input (json) – Optional. Keep only resources with a specific workflow input.

  • workflow_params (json) – Optional. Keep only resources with specific workflow parameters.

  • scope (Enum(private, public)) – Optional. Keep only resources with a specific scope.

  • pattern (str) – Optional. Keep only resources with a specific pattern.

  • remaining_executions (integer) – Optional. Keep only resources with a specific number of remaining executions.

  • project_id (uuid) – Optional. Keep only resources with the specific project id.

  • first_execution_time (str) – Optional. Keep only resources with a specific time and date of first execution.

  • next_execution_time (str) – Optional. Keep only resources with a specific time and date of next execution.

  • created_at (str) – Optional. Keep only resources created at a specific time and date.

  • updated_at (str) – Optional. Keep only resources with specific latest update time and date.

  • all_projects (bool) – Optional. Get resources of all projects.

Return type:

CronTriggers

GET /v2/cron_triggers

Returns the named cron_trigger.

Parameters:
  • identifier (str) – Id or name of cron trigger to retrieve

  • fields (uniquelist) – Optional. A specified list of fields of the resource to be returned. ‘id’ will be included automatically in fields if it’s not provided.

Return type:

CronTrigger

POST /v2/cron_triggers

Creates a new cron trigger.

Parameters:
  • cron_trigger (CronTrigger) – Required. Cron trigger structure.

Return type:

CronTrigger

DELETE /v2/cron_triggers

Delete cron trigger.

Parameters:
  • identifier (str) – Id or name of cron trigger to delete

Environments

Environment contains a set of variables which can be used in specific workflow. Using an Environment it is possible to create and map action default values - just provide ‘__actions’ key in ‘variables’. All these variables can be accessed using the Workflow Language with the <% $.__env %> expression.

Example of usage:

workflow:
  tasks:
    task1:
      action: std.echo output=<% $.__env.my_echo_output %>

Example of creating action defaults

...ENV...
"variables": {
  "__actions": {
    "std.echo": {
      "output": "my_output"
    }
  }
},
...ENV...

Note: using CLI, Environment can be created via JSON or YAML file.

type Environment

Environment resource.

Data samples:

Json
{
    "created_at": "1970-01-01T00:00:00.000000",
    "description": "example environment entry",
    "id": "123e4567-e89b-12d3-a456-426655440000",
    "name": "sample",
    "project_id": "40a908dbddfe48ad80a87fb30fa70a03",
    "scope": "private",
    "updated_at": "1970-01-01T00:00:00.000000",
    "variables": "{\"server\": \"localhost\", \"database\": \"temp\", \"timeout\": 600, \"verbose\": true}"
}
type Environments

A collection of Environment resources.

Data samples:

Json
{
    "environments": [
        {
            "created_at": "1970-01-01T00:00:00.000000",
            "description": "example environment entry",
            "id": "123e4567-e89b-12d3-a456-426655440000",
            "name": "sample",
            "project_id": "40a908dbddfe48ad80a87fb30fa70a03",
            "scope": "private",
            "updated_at": "1970-01-01T00:00:00.000000",
            "variables": "{\"server\": \"localhost\", \"database\": \"temp\", \"timeout\": 600, \"verbose\": true}"
        }
    ]
}
next
Type:

str

A link to retrieve the next subset of the resource list

GET /v2/environments

Return all environments.

Where project_id is the same as the requester or project_id is different but the scope is public.

Parameters:
  • marker (uuid) – Optional. Pagination marker for large data sets.

  • limit (int) – Optional. Maximum number of resources to return in a single result. Default value is None for backward compatibility.

  • sort_keys (uniquelist) – Optional. Columns to sort results by. Default: created_at, which is backward compatible.

  • sort_dirs (list) – Optional. Directions to sort corresponding to sort_keys, “asc” or “desc” can be chosen. Default: desc. The length of sort_dirs can be equal or less than that of sort_keys.

  • fields (uniquelist) – Optional. A specified list of fields of the resource to be returned. ‘id’ will be included automatically in fields if it’s not provided, since it will be used when constructing ‘next’ link.

  • name (str) – Optional. Keep only resources with a specific name.

  • description (str) – Optional. Keep only resources with a specific description.

  • variables (json) – Optional. Keep only resources with specific variables.

  • scope (Enum(private, public)) – Optional. Keep only resources with a specific scope.

  • created_at (str) – Optional. Keep only resources created at a specific time and date.

  • updated_at (str) – Optional. Keep only resources with specific latest update time and date.

Return type:

Environments

GET /v2/environments

Return the named environment.

Parameters:
  • name (str) – Name of environment to retrieve

  • fields (uniquelist) – Optional. A specified list of fields of the resource to be returned. ‘id’ will be included automatically in fields if it’s not provided.

Return type:

Environment

POST /v2/environments

Create a new environment.

Parameters:
  • env (Environment) – Required. Environment structure to create

Return type:

Environment

PUT /v2/environments

Update an environment.

Parameters:
  • env (Environment) – Required. Environment structure to update

Return type:

Environment

DELETE /v2/environments

Delete the named environment.

Parameters:
  • name (str) – Name of environment to delete

Services

Through service management API, system administrator or operator can retrieve Mistral services information of the system, including service group and service identifier. The internal implementation of this feature make use of tooz library, which needs coordinator backend(the most commonly used at present is Zookeeper) installed, please refer to tooz official documentation for more detailed instruction.

There are three service groups according to Mistral architecture currently, namely api_group, engine_group and executor_group. The service identifier contains name of the host that the service is running on and the process identifier of the service on that host.

type Service

Service resource.

Data samples:

Json
{
    "name": "host1_1234",
    "type": "executor_group"
}
type Services

A collection of Services.

Data samples:

Json
{
    "services": [
        {
            "name": "host1_1234",
            "type": "executor_group"
        }
    ]
}
GET /v2/services

Return all services.

Return type:

Services

Validation

Validation endpoints allow to check correctness of workbook, workflow and ad-hoc action Workflow Language without having to upload them into Mistral.

POST /v2/workbooks/validation

Validate workbook content (Workflow Language grammar and semantics).

POST /v2/workflows/validation

Validate workflow content (Workflow Language grammar and semantics).

POST /v2/actions/validation

Validate ad-hoc action content (Workflow Language grammar and semantics).

These endpoints expect workbook, workflow or ad-hoc action text (Workflow Language) correspondingly in a request body.

Code Sources

Code source is a type of entity that holds information about an executable module. Mostly, it was designed to represent as a Python module and this is its main use at the moment. However, it can also be used for other languages in future.

Code sources are now used as part of the dynamic actions mechanism. The normal flow is to first upload a code source, i.e. a regular Python file, and then create one or more dynamic actions using POST /v2/dynamic-actions and specifying the name of the action, its class name as it’s declared in the source code, and the reference to the source code itself.

type CodeSource

CodeSource resource.

Data samples:

Json
{
    "actions": [
        "action1",
        "action2",
        "action3"
    ],
    "content": "content of file",
    "created_at": "1970-01-01T00:00:00.000000",
    "id": "123e4567-e89b-12d3-a456-426655440000",
    "name": "module",
    "namespace": "",
    "project_id": "a7eb669e9819420ea4bd1453e672c0a7",
    "scope": "private",
    "updated_at": "1970-01-01T00:00:00.000000",
    "version": 1
}
type CodeSources

A collection of CodeSources.

Data samples:

Json
{
    "code_sources": [
        {
            "actions": [
                "action1",
                "action2",
                "action3"
            ],
            "content": "content of file",
            "created_at": "1970-01-01T00:00:00.000000",
            "id": "123e4567-e89b-12d3-a456-426655440000",
            "name": "module",
            "namespace": "",
            "project_id": "a7eb669e9819420ea4bd1453e672c0a7",
            "scope": "private",
            "updated_at": "1970-01-01T00:00:00.000000",
            "version": 1
        }
    ],
    "next": "http://localhost:8989/v2/code_sources?sort_keys=id,name&sort_dirs=asc,desc&limit=10&marker=123e4567-e89b-12d3-a456-426655440000"
}
next
Type:

str

A link to retrieve the next subset of the resource list

GET /v2/code-sources

Return a list of Code Sources.

Parameters:
  • marker (uuid) – Optional. Pagination marker for large data sets.

  • limit (int) – Optional. Maximum number of resources to return in a single result. Default value is None for backward compatibility.

  • sort_keys (uniquelist) – Optional. Columns to sort results by. Default: created_at.

  • sort_dirs (list) – Optional. Directions to sort corresponding to sort_keys, “asc” or “desc” can be chosen. Default: asc.

  • fields (uniquelist) – Optional. A specified list of fields of the resource to be returned. ‘id’ will be included automatically in fields if it’s provided, since it will be used when constructing ‘next’ link.

  • name (str) – Optional. Keep only resources with a specific name.

  • namespace (str) – Optional. Keep only resources with a specific namespace

  • tags (str) – Optional. Keep only resources containing specific tags.

  • scope (Enum(private, public)) – Optional. Keep only resources with a specific scope.

  • project_id (uuid) – Optional. The same as the requester project_id or different if the scope is public.

  • created_at (str) – Optional. Keep only resources created at a specific time and date.

  • updated_at (str) – Optional. Keep only resources with specific latest update time and date.

  • all_projects (bool) – Optional. Get resources of all projects.

Return type:

CodeSources

GET /v2/code-sources

Return a code source.

Parameters:
  • identifier (str) – Name or UUID of the code source to retrieve.

  • namespace (str) – Optional. Namespace of the code source to retrieve.

Return type:

CodeSource

POST /v2/code-sources

Creates new code sources.

Parameters:
  • name – Code source name (i.e. the name of the module).

  • scope – Optional. Scope (private or public).

  • namespace – Optional. The namespace to create the code sources in.

PUT /v2/code-sources

Update code source.

Parameters:
  • identifier – Identifier (name or ID) of the code source.

  • scope – Scope (private or public) of the code source.

  • namespace – Optional. The namespace of the code source.

DELETE /v2/code-sources

Delete a code source.

Parameters:
  • identifier (str) – Name or ID of Code Source to delete.

  • namespace (str) – Optional. Namespace of the Code Source to delete.

Dynamic Actions

Dynamic action is the type of action that can be created right through the API, without having to reboot Mistral like in other cases.

Before adding a dynamic action, a client first needs to upload a code source (i.e. a Python module) that contains the corresponding Python class that implements the action, and then create the action using the method POST /v2/dynamic-actions where the name of the action, its class name as it’s declared in the code source code, and the reference to the source code itself must be specified.

type DynamicAction

DynamicAction resource.

Data samples:

Json
{
    "class_name": "className",
    "code_source_id": "233e4567-354b-12d3-4444-426655444444",
    "code_source_name": "my_sample_module",
    "created_at": "1970-01-01T00:00:00.000000",
    "id": "123e4567-e89b-12d3-a456-426655440000",
    "name": "actionName",
    "namespace": "",
    "project_id": "a7eb669e9819420ea4bd1453e672c0a7",
    "scope": "private",
    "updated_at": "1970-01-01T00:00:00.000000"
}
type DynamicActions

A collection of DynamicActions.

Data samples:

Json
{
    "dynamic_actions": [
        {
            "class_name": "className",
            "code_source_id": "233e4567-354b-12d3-4444-426655444444",
            "code_source_name": "my_sample_module",
            "created_at": "1970-01-01T00:00:00.000000",
            "id": "123e4567-e89b-12d3-a456-426655440000",
            "name": "actionName",
            "namespace": "",
            "project_id": "a7eb669e9819420ea4bd1453e672c0a7",
            "scope": "private",
            "updated_at": "1970-01-01T00:00:00.000000"
        }
    ],
    "next": "http://localhost:8989/v2/dynamic_actions?sort_keys=id,name&sort_dirs=asc,desc&limit=10&marker=123e4567-e89b-12d3-a456-426655440000"
}
next
Type:

str

A link to retrieve the next subset of the resource list

GET /v2/dynamic-actions

Return a list of Actions.

Parameters:
  • marker (uuid) – Optional. Pagination marker for large data sets.

  • limit (int) – Optional. Maximum number of resources to return in a single result. Default value is None for backward compatibility.

  • sort_keys (uniquelist) – Optional. Columns to sort results by. Default: created_at.

  • sort_dirs (list) – Optional. Directions to sort corresponding to sort_keys, “asc” or “desc” can be chosen. Default: asc.

  • fields (uniquelist) – Optional. A specified list of fields of the resource to be returned. ‘id’ will be included automatically in fields if it’s provided, since it will be used when constructing ‘next’ link.

  • name (str) – Optional. Keep only resources with a specific name.

  • namespace (str) – Optional. Keep only resources with a specific namespace

  • input – Optional. Keep only resources with a specific input.

  • definition – Optional. Keep only resources with a specific definition.

  • tags (str) – Optional. Keep only resources containing specific tags.

  • scope (Enum(private, public)) – Optional. Keep only resources with a specific scope.

  • project_id (uuid) – Optional. The same as the requester project_id or different if the scope is public.

  • created_at (str) – Optional. Keep only resources created at a specific time and date.

  • updated_at (str) – Optional. Keep only resources with specific latest update time and date.

  • all_projects (bool) – Optional. Get resources of all projects.

Return type:

DynamicActions

GET /v2/dynamic-actions

Return the named action.

Parameters:
  • identifier (str) – Name or UUID of the action to retrieve.

  • namespace (str) – Optional. Namespace of the action to retrieve.

Return type:

DynamicAction

POST /v2/dynamic-actions

Creates new dynamic action.

Parameters:
Return type:

DynamicAction

PUT /v2/dynamic-actions

Update dynamic action.

Parameters:
Return type:

DynamicAction

DELETE /v2/dynamic-actions

Delete a dynamic action.

Parameters:
  • identifier (str) – Name or ID of the action to delete.

  • namespace (str) – Optional. Namespace of the action to delete.