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 |
---|---|---|---|
|
String |
Yes |
Name of the Workflow Engine Moolet to return workflows for. |
|
Boolean |
No |
Return only active workflows. |
Response
Method getWorkflows
returns a JSON array of workflow objects. Each
object has the following:
Name |
Type |
Description |
|||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Integer |
Unique ID of the workflow. |
|||||||||||||||||||||
|
String |
Name of the Workflow Engine Moolet. |
|||||||||||||||||||||
|
String |
Name of the workflow. |
|||||||||||||||||||||
|
String |
Description of the workflow. |
|||||||||||||||||||||
|
Integer |
Sequence number of the workflow. |
|||||||||||||||||||||
|
Boolean |
Indicates whether or not the Moolet's associated Workflow Engine is active. |
|||||||||||||||||||||
|
JSON Object |
Filter in SQL-like or JSON format to determine which events, alerts, or Situations can enter the workflow. If empty, the workflow accepts all events, alerts or Situations. |
|||||||||||||||||||||
|
JSON Object |
Filter in SQL-like or JSON format to intake any additional alerts or Situations from the database. Not relevant for event workflows. |
|||||||||||||||||||||
|
Boolean |
If enabled, alerts and Situations only pass through actions on the first time they enter the Workflow Engine. Not relevant for event workflows. |
|||||||||||||||||||||
|
JSON List |
List of properties relating to each operation:
|
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": { "left": { "left": { "op": 0, "column": "sig_id", "type": "LEAF", "value": 1 }, "oper": "AND", "right": { "op": 4, "column": "delta_priority", "type": "LEAF", "value": 0 }, "type": "BRANCH" }, "oper": "AND", "right": { "op": 0, "column": "category", "type": "LEAF", "value": "Closed" }, "type": "BRANCH" }, "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": { "left": { "op": 0, "column": "category", "type": "LEAF", "value": "Closed" }, "oper": "AND", "right": { "op": 0, "column": "created_at", "type": "LEAF", "value": 1574121600 }, "type": "BRANCH" }, "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": { "op": 0, "column": "status", "type": "LEAF", "value": 9 }, "active": true, "description": "You can optionally use this workflow to prevent closed Situations from processing.", "sweep_up_filter": null, "id": 4 } ]