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 | 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. | |||||||||||||||||||||
| 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. | |||||||||||||||||||||
| 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. | |||||||||||||||||||||
| 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": "((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 } ]