Skip to main content

getWorkflows

A MoogDb v2 method that returns workflows for a Workflow Engine Moolet.

Back to MoogDb V2 API Method Reference.

Request arguments

Method getWorkflows takes the following request arguments:

Name

Type

Required

Description

mooletName

String

Yes

Name of the Workflow Engine Moolet to return workflows for.

activeOnly

Boolean

Return only active workflows.

Response

Method getWorkflows returns a JSON array of workflow objects. Each object has 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 method getWorkflows:

Request example

Example request to workflows associated with the "Situation Workflows" Moolet:

var response = moogdb.getWorkflows("Situation Workflows");

Response example

Example response returning details of the workflows associated with the "Situation Workflows" Moolet:

[
  {
    "first_match_only": true,
    "sequence": 1,
    "operations": [
      {
        "duration": 120,
        "reset": false,
        "type": "delay"
      },
      {
        "operation_name": "Create Ticket",
        "function_name": "createServiceTicket",
        "forwarding_behavior": "always forward",
        "function_args": {
          "services": "ServiceNow, Remedy, Cherwell, Jira Service Desk, Jira Software"
        },
        "type": "action"
      }
    ],
    "moolet_name": "Situation Workflows",
    "workflow_name": "Automated Ticketing",
    "entry_filter": "((category = \"Closed\") AND (custom_info.test = \"test\")) AND (description = \"test\")",
    "active": false,
    "description": "You can optionally use this workflow if you use UI ticketing integrations. It creates tickets in the ticketing system as Situations are actioned.",
    "sweep_up_filter": "((sig_id = 1) AND (first_event_time = 1574121600)) AND (description = \"test\")",
    "id": 1
  },
  {
    "first_match_only": false,
    "sequence": 2,
    "operations": [
      {
        "duration": 0,
        "reset": false,
        "type": "delay"
      },
      {
        "operation_name": "Stop Situation",
        "function_name": "stop",
        "forwarding_behavior": "Stop All Workflows",
        "type": "action"
      }
    ],
    "moolet_name": "Situation Workflows",
    "workflow_name": "Closed Situation Filter",
    "entry_filter": "status = 9",
    "active": true,
    "description": "You can optionally use this workflow to prevent closed Situations from processing.",
    "sweep_up_filter": "",
    "id": 4
  }
]