Overview
Actionflows that require running at a particular time or frequency can be scheduled using a Task Plan.
Creating Task Plans
- In your application's Repository, expand Task Plan and click Create New
- In the Basic Settings for the New Task Plan, set:
- Name: Give the task plan a name to indicate its purpose
- Enabled: to indicate the task plan configuration is complete and it can be run
- Scheduled: to open a Schedule section in the properties, where the day and time that the task plan will run can be configured
- Suspend on Failure: to automatically suspend the task plan if it generates an error on running
- For more details on these settings and further options, see Task Plans.
- Click Apply
Creating an Action Task
- In the Tasks section, hover over the icon and choose Action Task
- In the Basic Settings for the New Action Task, set:
- Name: Give the action task a suitable name
- Click Apply.
- In the Actionflow Instance section, click the icon to open a list of Actionflows in the Repository
- Or click the icon to create a new one
- Drag the required Actionflow(s) into the Actionflow Instance section
- Click Apply and Close
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
- 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
- Email from: This must be the email account used to send emails from PhixFlow
Subject Expression: Enter an appropriate subject
Message Expression: Enter an appropriate message
- Notification: click
- In the Notification section, select
- To set up the User Notification Rule, See User Notification Rule
- 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.
- To run manually, right-click on the task plan in the Repository and select Start
- PhixFlow runs the task plan and sends an email to the selected user, if set up
- To run on a schedule, toggle on Scheduled in the Task Plan Properties
- In the Schedule section, populate the appropriate fields to schedule the task plan, see Task Plans
- 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
- On the Actionflow homepage, create a new Actionflow
- Name: Timesheet Email
- Create a Calculate action
- Name: Retrieve Staff Emails
- Hover over the Calculate action to select Add Lookup
- Name:
RE
- Name:
- Create a lookup to the Shop_Staff data and output the email addresses
- Ensure the email attribute is mapped as an Outgoing Mapping and an Output Attribute
- On the View, create a filter:
- Where ANY of the following are true:
- staffID
- equals
4385800847
- staffID
- equals
1546843809
- staffID
- Where ANY of the following are true:
- On the Calculate action, create an attribute to process the email addresses
- Name:
EmailAddresses
Expression:
listToString(RE.email)
- Name:
- Create a Email action and connect it to the Calculate action
- Map across the EmailAddresses attribute
- Click on the Email action to open its Properties and pin the tab
- 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
- Double-click on Outbound emailer and copy the login email
- Paste this into the From field on your pinned Email properties
- To:
enter your email address
- This way you can see if the Actionflow is working
CC:
${in.EmailAddresses}
Subject:
Timesheet Reminder
Message:
Please ensure your timesheet is completed by close of play today.
- Leave all other fields blank
Apply and Close
- 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
Create Task Plan
- In the Repository, expand Task Plan and click Create New
- In the Basic Settings for the New Task Plan, set:
- Name:
Weekly Timesheet Reminder
- Enabled:
- Scheduled:
- Suspend on Failure:
- Name:
Task Plan Schedule
Schedule the task plan to run on a specified day at a specified time.
- In the Schedule section, populate the following fields:
- Seconds: 0
- Minutes: 0
- Hours: 10
- 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
- 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
- Day of Month: ?
- Month: *
- Day of Week: FRI
- Choose today's day of the week so you can see the results of the task plan
- Year: *
Apply the task plan
Receive Notification of Task Plan Completion
Set up an email configuration to receive notification that the task plan has completed.
- 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
- Email From: This must be the email account used to send emails from PhixFlow
Subject Expression: "
Weekly Timesheet Reminder Task Plan"
Message Expression: "
The Task Plan has completed."
- Notification: set up your own email address here
- Click Apply
Creating the Action Task
- In the Tasks section, hover over the icon and choose Action Task
- Name: Timesheet Email
- Click Apply.
- Actionflow Instance: click the icon to open the list of Actionflows
- Drag across the Timesheet Email Actionflow into the Actionflow Instance section
- The Actionflow instance canvas will open
- Click Click to Connect and choose an input of Task Plan
- Wait for the task plan to run at your chosen time