Automate pipeline execution with schedules, webhooks, and event triggers.
| Type | Description |
|---|---|
MANUAL |
Run via UI or API |
SCHEDULE |
Cron-based timing |
WEBHOOK |
HTTP endpoint trigger |
EVENT |
Vendure event trigger |
FILE |
File arrival trigger |
MESSAGE |
Message queue trigger |
The default trigger type. Run pipelines on demand:
.trigger('start', { type: 'MANUAL' })
Run pipelines automatically based on cron expressions.
.trigger('schedule', {
type: 'SCHEDULE',
cron: '0 2 * * *', // Daily at 2 AM
timezone: 'UTC',
})
┌───────────── minute (0-59)
│ ┌───────────── hour (0-23)
│ │ ┌───────────── day of month (1-31)
│ │ │ ┌───────────── month (1-12)
│ │ │ │ ┌───────────── day of week (0-6, 0=Sunday)
│ │ │ │ │
* * * * *
| Expression | Description |
|---|---|
* * * * * |
Every minute |
*/5 * * * * |
Every 5 minutes |
0 * * * * |
Every hour |
0 0 * * * |
Daily at midnight |
0 2 * * * |
Daily at 2 AM |
0 0 * * 0 |
Weekly on Sunday |
0 0 1 * * |
Monthly on the 1st |
0 6,18 * * * |
At 6 AM and 6 PM |
0 0 * * 1-5 |
Weekdays at midnight |
Specify the timezone for schedule interpretation:
.trigger('schedule', {
type: 'SCHEDULE',
cron: '0 9 * * *', // 9 AM in specified timezone
timezone: 'America/New_York',
})
Common timezones:
UTC - Coordinated Universal TimeAmerica/New_York - Eastern TimeAmerica/Los_Angeles - Pacific TimeEurope/London - British TimeEurope/Berlin - Central European TimeAsia/Tokyo - Japan TimeTrigger pipelines via HTTP POST requests.
.trigger('webhook', {
type: 'WEBHOOK',
webhookPath: '/product-sync',
authentication: 'HMAC',
requireIdempotencyKey: true,
idempotencyKeyHeader: 'X-Request-ID',
})
Webhooks are available at:
POST /data-hub/webhook/{pipeline-code}
For a pipeline with code product-import:
POST https://your-vendure.com/data-hub/webhook/product-import
Send data in the request body. This data is available to the pipeline:
curl -X POST https://your-vendure.com/data-hub/webhook/product-import \
-H "Content-Type: application/json" \
-d '{"productId": "123", "action": "update"}'
For security, enable HMAC signature verification:
.trigger('webhook', {
type: 'WEBHOOK',
authentication: 'HMAC',
secretCode: 'webhook-secret',
})
X-Hub-Signature-256: sha256=abc123...
Prevent duplicate processing with idempotency keys:
.trigger('webhook', {
type: 'WEBHOOK',
requireIdempotencyKey: true,
idempotencyKeyHeader: 'X-Request-ID',
})
Send a unique ID in the header:
X-Request-ID: unique-request-id-123
The same ID will not trigger the pipeline twice within 24 hours.
Trigger pipelines when Vendure events occur.
.trigger('on-order', {
type: 'EVENT',
event: 'OrderPlacedEvent',
filter: {
state: 'ArrangingPayment',
},
})
| Event | Description |
|---|---|
OrderPlacedEvent |
New order created |
OrderStateTransitionEvent |
Order status changed |
ProductEvent |
Product created/updated/deleted |
ProductVariantEvent |
Variant changes |
CustomerEvent |
Customer changes |
CollectionModificationEvent |
Collection changes |
StockMovementEvent |
Inventory changes |
Only trigger on specific conditions:
.trigger('on-completed-order', {
type: 'EVENT',
event: 'OrderStateTransitionEvent',
filter: {
toState: 'Delivered',
},
})
Disable a pipeline to pause its schedule:
The schedule remains configured but won’t trigger.
Changes take effect immediately.
By default, a new run cannot start if the previous run is still in progress.
Options:
Configure via pipeline capabilities:
.capabilities({
allowConcurrent: false, // Skip overlapping runs
})