2.17 Scheduling Actionflows

Overview

Actionflows that require running at a particular time or frequency can be scheduled using a  Task Plan

Creating Task Plans

  1. In your application's Repository, expand  Task Plan and click  Create New
  2. In the Basic Settings for the New Task Plan, set: 
    1. Name: Give the task plan a name to indicate its purpose
    2. Enabled to indicate the task plan configuration is complete and it can be run
    3. Scheduled:  to open a Schedule section in the properties, where the day and time that the task plan will run can be configured
    4. Suspend on Failure:  to automatically suspend the task plan if it generates an error on running
      1. For more details on these settings and further options, see Task Plans.
    5. Click  Apply

Creating an Action Task

  1. In the Tasks section, hover over the  icon and choose Action Task
  2. In the Basic Settings for the New Action Task, set:
    1. Name: Give the action task a suitable name
    2. Click  Apply.
  3. In the Actionflow Instance section, click the  icon to open a list of Actionflows in the Repository
    1. Or click the  icon to create a new one
    1. Drag the required Actionflow(s) into the Actionflow Instance section
    2. The Actionflow instance canvas will open
      1. Click Click to Connect and choose an input of Task Plan

If you require many Actionflows to run at the same time, they can all be included in the same Action Task.

For more on tasks, see Task.

Configuring Send By Email

  1. On the Task Plan settings, in the Send By Email section, set:
    • Email from: This must be the email account used to send emails from PhixFlow
      • To find this, in the  Full Repository, expand  Email Accounts
      • Double-click on  Outbound emailer and copy the login email 
    • Subject Expression: Enter an appropriate subject

    • Message Expression: Enter an appropriate message 

    • Notification: click 
  1. In the Notification section, select
    1. To set up the User Notification Rule, See User Notification Rule
  2. Click  Apply and Close

Running and Scheduling Task Plans

Task plans can either be run manually from the Repository or run automatically by setting up a schedule.

  1. To run manually, right-click on the task plan in the Repository and select  Start
    1. PhixFlow runs the task plan and sends an email to the selected user, if set up
  2. To run on a schedule, toggle on Scheduled in the Task Plan  Properties
  3. In the Schedule section, populate the appropriate fields to schedule the task plan, see Task Plans
  4. Wait for your task plan to start under its schedule

Worked Example

Here is a worked example using the Retail Data (available from the Learning Centre).

If you are completing this chapter as part of the Actionflow course and using a training instance, the data and screens have already been pre-loaded into the Actionflow Intermediate Application. For these example, we'll be working on the Shop Stock screen

Weekly Timesheet Reminder Email

In this example, we'll set up an Actionflow that retrieves the email address for specific staff members and sends them an email to remind them to fill in their timesheets. We'll then add this Actionflow to a Task Plan and specify the frequency (weekly) and day (Friday) that we want the email to be sent on.

Create Actionflow

  1. On the Actionflow homepage, create a new Actionflow
    1. Name: Timesheet Email
  2. Create a  Calculate action
    1. Name: Retrieve Staff Emails
  3. Hover over the  Calculate action to select Add Lookup
    1. Name: RE
  4. Create a lookup to the Shop_Staff data and output the email addresses
    1. Ensure the email attribute is mapped as an Outgoing Mapping and an Output Attribute
  5. On the   View, create a filter:
    1. Where ANY of the following are true:
      1. staffID
        1. equals
        2. 4385800847
      2. staffID
        1. equals
        2. 1546843809

  6. On the Calculate action, create an attribute to process the email addresses
    1. Name: EmailAddresses 
    2. Expression: 

      listToString(RE.email)
  7. Create a  Email action and connect it to the Calculate action
    1. Map across the EmailAddresses attribute 
  8. Click on the Email action to open its Properties and pin the tab
    1. For the From field, we need to use the email address specified as the login email in your Outbound Emailer; to find this, in the  Full Repository, expand  Email Accounts
      1. Double-click on  Outbound emailer and copy the login email 
    2. Paste this into the From field on your pinned  Email properties
    3. To: enter your email address
      1. This way you can see if the Actionflow is working
    4. CC: 

      ${in.EmailAddresses}
    5. Subject:

      Timesheet Reminder
    6. Message:

      Please ensure your timesheet is completed by close of play today.
    7. Leave all other fields blank
    8.  Apply and Close

 Checkpoint

Create Task Plan

  1. In the Repository, expand  Task Plan and click  Create New
  2. In the Basic Settings for the New Task Plan, set: 
    1. Name: Weekly Timesheet Reminder
    2. Enabled 
    3. Scheduled: 
    4. Suspend on Failure: 

Task Plan Schedule

Schedule the task plan to run on a specified day at a specified time.

  1. In the Schedule section, populate the following fields:
    1. Seconds: 0
    2. Minutes: 0
    3. Hours: 10
      1. Choose an appropriate time to enter here based on the time where you are now so you can see the results of the task plan 
      2. Due to international time differences, the time in PhixFlow may be different to where you are. Check the  System Console for the time in PhixFlow
    4. Day of Month: ?
    5. Month: *
    6. Day of Week: FRI
      1. Choose today's day of the week so you can see the results of the task plan 
    7. Year: *
  2.  Apply the task plan

Receive Notification of Task Plan Completion

Set up an email configuration to receive notification that the task plan has completed.

  1. In the Send By Email section, set:
    • Email From: This must be the email account used to send emails from PhixFlow
      • To find this, in the  Full Repository, expand  Email Accounts
      • Double-click on  Outbound emailer and copy the login email 
    • Subject Expression: "Weekly Timesheet Reminder Task Plan"

    • Message Expression: "The Task Plan has completed."

    • Notification: set up your own email address here
  1. Click  Apply

Creating the Action Task

  1. In the Tasks section, hover over the  icon and choose Action Task
    1. Name: Timesheet Email
    2. Click  Apply.
    3. Actionflow Instance: click the  icon to open the list of Actionflows 
    4. Drag across the Timesheet Email Actionflow into the Actionflow Instance section
    1. The Actionflow instance canvas will open
      1. Click Click to Connect and choose an input of Task Plan
  2. Wait for the task plan to run at your chosen time