Skip to main content

Environment Variables

All process.env access in the package lives in src/shared/config.ts. Nowhere else in the bundles reads process.env — keep this invariant when extending the code.

Both sides

VariableRequiredDefaultDescription
SYNC_SHARED_SECRETyesShared secret. HMAC key (hmac mode) or bearer token (token mode).
SYNC_AUTH_MODEnohmachmac | token — must match on publisher and subscriber. See Authentication.
SYNC_ENTITIESnoworkflows,credentialsComma-separated subset of workflows, credentials, executions to sync. Unknown names are dropped. When executions is included, the publisher registers workflow.postExecute and the subscriber resolves the ExecutionRepository. See Wired Hooks.
LOG_LEVELnoinfodebug | info | warn | error. Structured JSON logger.

Publisher

VariableRequiredDefaultDescription
SYNC_SUBSCRIBER_URLSyesComma-separated target base URLs (fan-out). Falls back to SYNC_SUBSCRIBER_URL if unset.
SYNC_SUBSCRIBER_URLnoLegacy single-target form of SYNC_SUBSCRIBER_URLS.
SYNC_SOURCE_IDnohostnameIdentifier stamped on every event.
SYNC_EVENTS_PATHno/rest/sync/v1/eventsEndpoint path on the subscriber.
SYNC_TIMEOUT_MSno10000Per-attempt HTTP timeout.
SYNC_MAX_RETRIESno3Total delivery attempts per event.
SYNC_FILTER_BY_TAGnofalseWhen true, sync only workflows that carry SYNC_WORKFLOW_TAG. See Tag-based Filtering.
SYNC_WORKFLOW_TAGnosyncWorkflow tag name that gates syncing. Effective only when SYNC_FILTER_BY_TAG=true.
SYNC_ACTIVE_TAGnoactiveTag name that rewrites the DTO active to true (real value preserved in meta.active_real). Effective only when SYNC_FILTER_BY_TAG=true.

Subscriber

VariableRequiredDefaultDescription
SYNC_ROUTE_BASEno/rest/sync/v1Base path for the mounted routes.
SYNC_TARGET_PROJECT_IDnoLink newly synced workflows/credentials to this project (*:owner role).
SYNC_APPLY_ACTIVE_STATEnofalseAlso write active/activeVersionId (see Limitations).
SYNC_MAX_BODY_BYTESno16777216Request body size cap.
SYNC_SIGNATURE_TOLERANCE_MSno300000Max signature age/skew accepted in hmac mode.
N8N_DI_PATHno/usr/local/lib/node_modules/n8n/node_modules/@n8n/diPath to n8n's @n8n/di module.
N8N_DB_PATHno/usr/local/lib/node_modules/n8n/node_modules/@n8n/dbPath to n8n's @n8n/db module.

Defaults at a glance

# Minimal publisher
export EXTERNAL_HOOK_FILES=/opt/n8n-sync/publisher.cjs
export SYNC_SUBSCRIBER_URLS=https://target.example.com
export SYNC_SHARED_SECRET=<secret>

# Minimal subscriber
export EXTERNAL_HOOK_FILES=/opt/n8n-sync/subscriber.cjs
export SYNC_SHARED_SECRET=<secret>

Every other setting has a sensible default and only needs to be set when you want non-default behavior. See the Quick Start for a complete walkthrough.

Reference