Mautic requires scheduled tasks, known as cron jobs, to run in the background to fulfill the “automation” part of being a marketing automation software.
The four primary cron jobs that are the pillar of automation tasks in a Mautic instance include:
- mautic:segments:update – Updates dynamic segments with contacts that meet the criteria of one or more filters. A contact filter might be based on the condition that a contact field is not blank, or contains a certain value.
- mautic:campaigns:update – Adds contacts to a campaign when their segment membership matches, or they fill a campaign form corresponding to the Contact Source of a campaign. Then, the job evaluates them against decisions (e.g. visited a page) and conditions (e.g. has valid email address). Finally, it queues them into “pending” status for the applicable actions (e.g. send email) in the decision tree.
- mautic:campaigns:trigger – Executes pending campaign actions. Without this cron job, campaign actions will only be queued by the previous job, but not executed. Campaign emails are sent by this job.
- mautic:broadcasts:send – Sends segment emails that are scheduled outside in Mautic outside of a campaign. Typically used for one-off email communications with a clear start (publish-up) and end date (publish-down).
These cron jobs are configured to execute the most frequently within our Mautic container image for Autoize™ Marketing Automation Infrastructure — every two minutes.
As an example, when a website visitor opts in via a form that feeds into a campaign, they might expect to receive a double opt-in confirmation email, or link to a downloadable asset. With a cron schedule of every two minutes, the email might land in their inbox in somewhere between two to six minutes as the system runs through the segment update, campaign update, and campaign trigger jobs.
The execution frequency can be customized. At the same time, it’s important to bear in mind that scheduling the cron job more often consumes additional system resources, even though it may reduce the delay in executing an automation action.
We do not typically recommend executing cron jobs more frequently than every two minutes. First, it gives the system an opportunity to finish processing the previous cron execution – even though Mautic itself has a safeguard to prevent the same job from executing concurrently. Secondly, it avoids increasing the system load to the threshold that it negatively impacts other instances hosted on the same server.
Besides the cron jobs listed above, other crons are also scheduled in the background (at various frequencies) of the marketing automation instances deployed with our Docker container. These jobs facilitate other features of Mautic such as background imports, email queuing, monitored inbox, social monitoring, webhooks processing, scheduled reports, and database cleanup.