Moogsoft Docs

getWorkflows

A Graze API GET request that returns workflows for a specified Workflow Engine Moolet.

Back to Graze API EndPoint Reference.

Request arguments

Endpoint getWorkflows takes the following request arguments:

Name

Type

Required

Description

auth_token

String

Yes

A valid auth_token returned from the authenticate request. See the authenticate endpoint for more information.

moolet_name

String

Yes

Name of the Workflow Engine Moolet that you want to return the workflows for.

Response

Endpoint getWorkflows returns the following response:

Successful requests return a JSON object containing the following:

Name

Type

Description

id

Integer

Unique ID of the workflow.

moolet_name

String

Name of the Moolet.

workflow_name

String

Name of the workflow.

description

String

Description of the workflow.

sequence

Integer

Sequence number of the workflow.

active

Boolean

Indicates whether or not the Moolet's associated Workflow Engine is active.

entry_filter

JSON

Filter to determine which events, alerts, or Situations can enter the workflow. If empty, the workflow accepts all events, alerts or Situations.

sweep_up_filter

JSON

Filter to intake any additional alerts or Situations from the database. Not relevant for event workflows.

first_match_only

Boolean

If enabled, alerts and Situations only pass through actions on the first time they enter the Workflow Engine. Not relevant for event workflows.

operations

JSON List

List of properties relating to each operation:

Name

Type

Description

type

String

Type of operation. Options are: 'action', 'decision' and 'delay'.

operation_name

String

Name of the operation. Only relevant for 'action' and 'decision' types.

function_name

String

Name of the function. Only relevant for 'action' and 'decision' types.

function_args

JSON Object

Arguments for the function.

duration

Integer

Length of time before the message goes to the next operation. Only relevant for 'delay' type.

reset

Boolean

Determines whether the timer resets after each occurrence. Only relevant for 'delay' type.

Examples

The following examples demonstrate typical use of endpoint getWorkflows:

Request example

Example cURL request to return workflows associated with the "Alert Workflows" Moolet:

curl -G -u graze:graze -k -v "https://localhost/graze/v1/getWorkflows" -H "Content-Type: application/json; charset=UTF-8" --data-urlencode "moolet_name=Alert Workflows"

Response example

Example response returning information on the workflows associated with the "Alert Workflows" Moolet:

[
    {
        "id": 1,
        "moolet_name": "Alert Workflows",
        "workflow_name": "ChangeInfoWorkflow",
        "sequence": 1,
        "active": true,
        "description": "Changingthealertinformation",
        "entry_filter": {
            "column": "severity",
            "op": 5,
            "value": 3,
            "type": "LEAF"
        },
        "sweep_up_filter": {
            "column": "description",
            "op": 4,
            "value": "description",
            "type": "LEAF"
        },
        "first_match_only": true,
        "operations": [
            {
                "type": "action",
                "function_name": "functionA",
                "operation_name": "Name of operation",
                "function_args": {
                    "admin": 2
                }
            },{
                "type": "delay",
                "delay": 30,
                "reset": false
            }
        ]
    }
]