Skip to content

Creating a new workflow

Aaron Wells edited this page May 21, 2018 · 8 revisions

Here's how you might create a simple workflow to send an HTTP request in response to a user logging in.

Describe Workflow and choose event to monitor.

  1. As an admin, go to Site administration > plugins > Admin tools > Event Trigger

  2. Press "Add new trigger workflow"

Add new workflow

  1. Give the trigger a name/description to help you remember what it does.

  2. Search for an event to monitor and select it. This is a searchable list, if you enter the text "graded" you will see a list of related events.

Search event image

Manage workflow steps.

There are 3 types of steps:

  • Filter - Ability to check if the event meets certain conditions before processing it.
  • Lookup - Most core events only contain a small amount of information, this allows you to obtain extra information from Moodle to pass to the trigger/action. (for example a users email or the course fullname)
  • Trigger - this is an action such as an external HTTP post or email and should typically be the last step in your workflow.

Add an Http Post trigger

  1. Press "Add workflow step"
  2. Choose "Trigger" -> "Http Post"

Add workflow step

  1. Enter a name/description to help you remember what it does.
  2. Enter the url.
  3. Enter the http headers/parameters that should be used.

Trigger variable templates

When developing the action/ trigger workflow steps, you can include a range of variables contained from the event or from the lookups by using the format {fieldname} for example if you wanted to include user information in the http post parameters you would enter:

param1={user_email}&param2={user_firstname}

...and the users email and firstname would be passed to the external url with the names "param1" and "param2"

Clone this wiki locally