Skip to main content

getWorkflows

A Graze API GET request that returns workflows for a 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. Alternatively, basic authenticate headers can be used in place of this parameter. See the authenticate endpoint for more information and usage examples.

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 Workflow Engine 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

String

An SQL-like filter to determine which events, alerts, or Situations can enter the workflow. If empty, the workflow accepts all events, alerts or Situations.

See Filter Search Data for more information on creating SQL-like filters.

sweep_up_filter

String

An SQL-like filter to intake any additional alerts or Situations from the database. Not relevant for event workflows.

See Filter Search Data for more information on creating SQL-like filters.

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:

[
    {
        "first_match_only": false,
        "sequence": 1,
        "operations": [
        {
            "duration": 0,
            "reset": false,
            "type": "delay"
        },
        {
            "operation_name": "Stop Alert",
            "function_name": "stop",
            "forwarding_behavior": "stop all workflows",
            "type": "action"
        }],
        "moolet_name": "Alert Workflows",
        "workflow_name": "Closed Alerts Filter",
        "entry_filter": "state = 9",
        "active": true,
        "description": "You can optionally use this workflow to prevent closed alerts from processing.",
        "sweep_up_filter": "((agent = \"Test\") AND (significance = 0)) OR (severity = 0)",
        "id": 3
    }
]