Table of contents
Scheduled jobs allow setting incoming and outgoing configurations to run according to a customized schedule.
Creating and maintaining Scheduled jobs
Possible configuration fields:
- Name - A name describing the incoming or outgoing configuration the Scheduled job will trigger, i.e. Orders to Magento Incoming
- Identifier - A unique identifier for this scheduled job (this field is automatically generated based on the name).
- Description - Detailed description for the scheduled job.
- Disabled - A flag that indicates whether the scheduled job is disabled. Disabled scheduled jobs do not process data.
- Job - a field where you can choose to configure either an incoming or outgoing configuration.
- Incoming configuration - if you have selected an incoming configuration as a job in the previous step, you will be offered to choose an incoming configuration that you wish to trigger among the list of all available incoming configurations built on your environment.
- Route - if you have selected an outgoing configuration as a job in the previous step, you will be offered to choose a route that you wish to trigger among the list of all available routes built on your environment.
- Number of tasks to export - this field limits the number of tasks to trigger in a route. This can be configured to solve the following issue. In case the subscriber has subscribed to 1000 tasks at a time, it will push these 1000 items whenever the route is triggered. It might cause an API to crash with 500 server error. To avoid this, you can set the limit to 100 tasks and run the job every 5 minutes, so it could process 100 tasks out of 1000 tasks every 5 mins. More specifically, it would pick up the next 100 "new" tasks every 5 minutes.
- Expression - field for setting up a corn expression that will define how often the job is triggered.
- Timezone - a field for selecting your preferred time zone.
Setting up a Scheduled Job
To set up scheduled jobs, perform the following steps:
- Go to Settings -> scheduled Jobs.
- Hit "+" to create a new one.
- Select if you are triggering an incoming or an outgoing configuration (route) (you would need to do both for each route).
- Finally, configure a cron job to run every X time.
Note: You can validate your cron expression in Crontab Guru the link to which can be found below the cron expression field.
Note: If you have a real-time processing route, you only need to configure a scheduled job for an incoming configuration, and the outgoing configuration of the route will be executed automatically.
It is recommended to set up a limit for the number of tasks to export in a scheduled job for the outgoing configuration to prevent the tasks from timing out.
In case the tasks are unlimited, whenever the previous process is still running and the scheduled job starts the next one, it will get timed out.