Skip to content

Schedule a Workflow

A scheduled workflow has a schedule trigger instead of a form trigger. FlowMint creates a timer for it in Action Scheduler when you save it enabled, and removes the timer when you disable or delete it.

  • Periodic housekeeping, such as deleting form entries older than 90 days.
  • Keeping records in step with another system; see Importing records.
  • A regular report or reminder sent by email or to another system.

For something that should happen once, a set time after a submission, a schedule is the wrong tool: there is no “run once at” trigger.

{
"trigger": { "type": "schedule", "interval": "weekly", "day_of_week": 1, "hour": 9, "minute": 0 },
"steps": [ … ]
}
KeyWhat it doesDefault
intervalhourly, twicedaily, daily or weekly. Required.—
hour0–23, for daily and weekly.2
minute0–59, for daily and weekly.0
day_of_week1 (Monday) to 7 (Sunday), for weekly.1

Times are in the site’s timezone, set under Settings → General, not the server’s. hourly first runs one hour after you save, and twicedaily 12 hours after; both ignore hour and minute. A workflow has one trigger, so it runs either on a schedule or after a form, not both.

There is no form entry behind a scheduled run, so data, labels, entry and entry_files are empty and form.id is blank. Saving warns when a scheduled workflow uses data, entry or entry_files.

You can use now(…), env.site_name, env.site_url, env.admin_email, run.id, run.started_at, workflow.id, vars.* and the output of earlier steps.

{
"trigger": { "type": "schedule", "interval": "daily", "hour": 2, "minute": 0 },
"steps": [
{ "name": "find_old", "type": "fre_list_entries",
"config": { "older_than_days": 90, "limit": 500 } },
{ "name": "purge", "type": "fre_delete_entries",
"config": { "entries": "{{ steps.find_old.entries }}" } },
{ "name": "report", "type": "log_info",
"config": { "message": "Deleted {{ steps.purge.deleted_count }} entries, {{ steps.purge.failed_count }} failed." } }
]
}

Without a form_id, fre_list_entries covers every form. Add one to limit it to a single form, and make one workflow per form for different retention periods.

  1. Open Tools → Scheduled Actions (on a WooCommerce site, WooCommerce → Status → Scheduled Actions).
  2. Search for fmw_scheduled_workflow_tick. Each enabled scheduled workflow has one pending action with its workflow id in the arguments and the next run time.
  3. After that time, its run appears in FlowMint Workflows → Run History with an empty form and entry #0.

To run it now, choose Run on that pending action. The next regular run keeps its time. Once a run exists, you can also replay it.

  • Missed runs are not made up. If WP-Cron does not fire for a while, the workflow runs once when it next fires, not once for each missed time, and a late run moves the following runs later by the same amount until FlowMint’s daily check resets the timers. A real cron job prevents both; see Installation and setup.
  • Runs can overlap. A run still going when the next is due does not stop the next. Keep each run short, for example with a limit on fre_list_entries.
  • No cron expressions or per-workflow timezones. Only the four intervals, in site time.
  • The timer is missing. FlowMint re-creates missing timers once a day. Saving the workflow again re-creates its timer at once. Check that it is enabled and its interval is one of the four values.

Available since FlowMint Workflows 0.6.0.