Skip to main content

Workflows

Workflows allow you to create a series of monitors, either for your already monitored ones or new ones, that will run in sequence. You can extract variables from the output of earlier calls in the Workflow and use them as part of the input to later ones in the Workflow. This simulates real-world business processes that involve multiple linked monitors, giving more realistic monitoring. The monitors can also be completely independent of each other.

Just like a normal monitor in APImetrics, Workflows are deployed to be run periodically from agents in the same way.

Example Workflow

Below is an example of a Workflow to give a clearer idea of the possibilities of a Workflow.

  1. monitor that creates a user in a particular system. Extract the user ID from the returned payload.
  2. monitor that creates a record associated with the user account for the user ID. Extract the record ID from the returned payload.
  3. monitor that obtains the record associated with the user account for the user ID and the record ID. Validate the returned payload using API Conditions to demonstrate that the record was created successfully.
  4. monitor that deletes the record associated with the user account for the user ID and the record ID.
  5. monitor that obtains the record associated with the user account for the user ID and the record ID. Validate the returned payload using API Conditions to demonstrate that the record was deleted successfully (trying to obtain a deleted record should lead to the returned payload containing an error message).
  6. monitor that deletes the user account associated with the user ID.
Variables in workflows

A variable used in a Workflow only persists for use in that Workflow. We provide pre-set variables for services like DATE and TIME, and global variables that can be used to handle externally generated tokens and IDs. To learn more about these, see APImetrics-defined variables.

Creating a Workflow

Workflows can be found under Configuration in the sidebar.

Sidebar Configure Monitoring menu with the Workflows option highlighted

To create a new Workflow, enter a name in the text field and then select the Add button.

Workflows page with the New Workflow name field and Add button highlighted

If you already have created some Workflows, they will be listed on the page.

Workflows page listing existing workflows with stop on failure, monitored, and last updated columns

To Edit a Workflow, select the row containing the Workflow and it will direct you to the Edit page.

Workflows list with a workflow row selected, opening the Edit Workflow page

To add an existing monitor to your Workflow, select the Add Step button below the Steps table.

Edit Workflow page with the Add Step and Add New Monitor buttons highlighted below the Steps table

After this, you can select from an existing monitor from the dropdown.

Edit Workflow step with the Select a monitor dropdown open listing existing monitors to add

You can also create a new monitor within the Edit Workflow page by selecting the Add New Monitor button.

Edit Workflow page with the Add New Monitor button highlighted to create a monitor within the workflow

Enter the details in the prompt, choosing the Method, URL, and Name before selecting the Add button to complete the new monitor.

New monitor entry form with Method, URL, and Name fields and an Add button inside the workflow

Variables and Conditions

Passing variables between Workflows is a key part of simulating a real business interaction. We have tutorials on parsing content in JSON and XML. There is also a set of pre-set variables that we provide, see our pre-set variables.

In case of a failure, there are Conditions, which allow you to stop Workflows. See the section on Assertions and conditions for more details on handling these situations.