Once a Flow is configured, tested thoroughly, and ready for execution, one of the most important things to consider is how the Flow should be executed. In Agillic, there are three different ways to execute a Flow. They are Manual Flow Executions, Scheduled Flow Executions, and Triggered Flow Executions.
In this article, we'll run through the three Flow Execution types as well as how to set up your Flow Executions.
Manual Flow Execution
In some cases, you may need to execute your Flow immediately. You can do this by executing it manually. This could, for example, be helpful when you're testing a campaign.
It's important to remember that you need to add a Target Group when you manually execute a Flow.
How to Manually Execute a Flow
- Make a Publish to Staging or Publish to Production, depending on where you want to execute your Flow. You can execute Flows on Production from the Staging environment or directly from Production. Be aware that all relevant entities, as well as updates related to your campaign, must be published from Staging to Production. This must happen before you're able to execute your flow successfully on Production.
- Open the Flows module.
- Select your Flow from the left sidebar and it will open in the work area.
- We recommend to always make a prediction on a Flow to test it before manual execution.
- Once tested, click on the Execute button in the Flow toolbar.
- A drop-down menu appears when you select the Execute button. Select whether you'd like to execute to Staging or Production.
- Click the 'Execute flow' button and confirm.
Your Flow has now been queued for execution and will execute as soon as possible. If multiple FLows are evaluating their Target Groups at the same time, a new execution will be added to the end of this queue.
If you're manually executing a Flow on Staging as part of a test, you may want to use the 'Redirect communication' feature. Learn how to test a Flow with redirect here.
The verification pop-up showed when attempting to manually execute a Flow
Scheduled Flow Execution
Adding a schedule to a Flow means Flow Executions can recur automatically. The available options are:
- One time (future execution)
- By the minute (every x minutes, between hh-hh) - with the option to 'Run only on weekdays'
- By the hour (every x hours, between hh-hh) - with the option to 'Run only on weekdays'
- Daily (every x days, at hh:mm:ss)
- Weekly (repeat every x weeks, on x days, starting at hh:mm:ss)
- Monthly (repeat every x months, starting at DD hh:mm) or (repeat every x months, at the first/second/third/fourth/last DD hh:mm:ss)
- Yearly (repeat every year, at MM-DD hh:mm:ss) or (repeat every year, at the first/second/third/fourth/last MM-DD hh:ss)
How to schedule a Flow
- Log in to the Staging environment
- Open the Flows module
- Select your Flow from the left sidebar and it will open in the work area.
- Open the Schedule panel tab on the right of the screen.
- Select which execution frequency you'd like to use. Remember not to schedule a flow if it hasn't been tested or verified as it could be published to Production with mistakes in it.
- Optional: If you'd like to schedule a Flow to execute at different times depending on a recipients' time zone, check the 'Send recipients based on their time zones' checkbox. The time zone feature must be enabled to do this.
- Optional: To avoid scheduled executions on Staging, check the 'Only execute on production' checkbox. We recommend to always check this box when adding a schedule. It prevents confusion as a Flow could otherwise execute for test-recipients on Staging. This setting only applies to scheduled Flows and not to Manual Executions, for example.
- Click the 'OK' button.
- Click the save icon in the Flows toolbar.
A schedule has now been added to the Flow. You may now choose to make a publish to Production to set the campaign live.
A Flow scheduled to execute Wednesday at 10:00, every week
Triggered Flow Execution
You can also add a trigger and execute a Flow, based on a recipient activity. This can be useful for Flows triggered by recipients signing up for a newsletter or an updated person Data field.
The trigger can be based on the following activities:
It's possible to add multiple triggers to the same Flow.
How to Add a Trigger to a Flow
- Log in to the Staging environment.
- Open the Flows module.
- Select your Flow from the left sidebar and it will open in the work area.
- Open the Trigger panel on the right side of the screen.
- Click the plus icon to add a new trigger.
- A drop-down menu will appear where you can select which activity should trigger the Flow. The most common way of triggering a Flow is using an Event as it can be achieved by an API call or a recipient clicking on a link. Learn how to create Events here.
- For all triggers (except 'Person Data Change') specify a counter for when the Flow will be triggered.
- Click the 'OK' button.
- Click the save icon in the Flows toolbar.
- Publish to Production to go live with your change
A trigger has now been added to the Flow. Now, you can publish to Production and the campaign will go live.
A triggered Flow with an Event added as the trigger
Suggested Next Steps
All You Need to Know About Flows