Skip to content

Trigger Import via Cron

Feed Me does not have a built-in scheduling tool, but you can trigger feeds by making an HTTP request, or via the CLI.

Regardless of how you trigger an import, the work is offloaded to Craft's queue.

WARNING

Make sure your queue configuration is suited for the volume and regularity of work generated from Feed Me. If you are using the default behavior (with runQueueAutomatically enabled), your feeds may not process immediately.

HTTP

A feed can be triggered any time by making a request to its Direct Feed URL. You can use this URL with a third-party scheduler, as a webhook endpoint (say, in a workflow or automation), or from a cron job on another server.

This URL includes a sensitive, feed-specific passkey that protects anonymous clients from triggering an import.

TIP

If you suspect a passkey is compromised, you can set a new one by visiting the feed’s Edit screen and replacing the Passkey field of sufficient length and complexity.

Console command

You can also trigger your feed to process via a console command by passing in a comma-separated list of feed IDs to process.

bash
# Process the feed with ID 1:
php craft feed-me/feeds/queue 1

# Process feeds with IDs 1, 2, and 3:
php craft feed-me/feeds/queue 1,2,3

# Import the first item returned by feed ID 1:
php craft feed-me/feeds/queue 1 --limit=1

# Import the second item returned by feed ID 1:
php craft feed-me/feeds/queue 1 --limit=1 --offset=1

# Log errors with individual items instead of failing:
php craft feed-me/feeds/queue 1 --continue-on-error

TIP

Imports that must be executed in a specific sequence should be pushed with a single command.

You can also supply a --all parameter to push all feeds into the queue. Note that this parameter will ignore any --limit and --offset parameters supplied.

bash
php craft feed-me/feeds/queue --all

WARNING

The feed-me/feeds/queue command only queues import jobs. To actually execute those jobs, the queue must be running—by default, the queue is triggered when your site is loaded by a client, or a control panel user is active. Projects with many feeds may benefit from setting up a daemonized runner, or manually running the queue on a schedule.