Skip to content

Copy definitions between environments

You have set something up by hand in one environment (QA, say) and want the same thing in another (production). Retyping loses detail. The console can export a record as a small JSON document and import that document into the create form of the other environment. It is a convenience for copying settings, not a deployment mechanism: nothing is written by either step except the final Create you press yourself.

Records that an application’s code owns are better kept in code and synced; see Declare definitions in code. Use export and import for the records you create by hand.

Kind From Imported into
Application Platform → Applications Create Application
Service account Identity & Access → Service Accounts Create service account
Connection Messaging → Connections Create Connection
Dispatch pool Messaging → Dispatch Pools Create Pool
Subscription Messaging → Subscriptions Create subscription

Event types are not copyable this way: they come from application sync.

  1. Open the record’s drawer (View details).
  2. Choose Export JSON. The JSON appears read-only with Copy and Download. The download is named <kind>-<code>.json, for example connection-billing-hooks.json.

Export reads what the drawer already shows, so you need no extra permission. If the drawer references a record you cannot read (a connection, say, because you cannot view connections), that key is left out and the export dialog says which. An id is never written in its place.

  1. In the other environment, open the same kind’s page and choose the create button.
  2. Choose Import from JSON at the top of the form, paste the JSON or pick the file, and submit.
  3. The form re-opens filled in, with a notice. Read it, fix anything it lists, and press Create as usual.

Importing never saves. The normal create checks still run when you press Create: permissions, validation, and CODE_EXISTS if the code is already taken (importing does not pre-check it).

Anything the import cannot apply is listed, never dropped quietly:

Notice Meaning What to do
“Connection billing-hooks was not found here. Import or create it first, then choose it.” A reference by code matched nothing in this environment, so the field is empty. Create the referenced record (import it first), then choose it in the form.
“… not applied by this form: orders:dispatcher” A value the create form cannot take, such as a service account’s roles. Apply it after creating, for example by assigning the roles.
Keys listed as ignored The JSON had keys this version does not know. Usually harmless; check the list.
“Imported. Review and create.” Everything applied. Create.

If the file is not JSON, is for another kind, or has an unknown version, the import is refused with a message and the form is left untouched.

{
"flowcatalyst": "definition",
"kind": "subscription",
"version": 1,
"definition": {
"code": "orders-hook",
"applicationCode": "orders",
"name": "Orders hook",
"endpoint": "https://billing.example.com/hooks/orders",
"clientScoped": true,
"clientIdentifier": "acme",
"eventTypes": [{ "eventTypeCode": "orders:sales:order:placed", "specVersion": "1.0" }],
"connectionCode": "billing-hooks",
"dispatchPoolCode": "orders-pool",
"mode": "NEXT_ON_ERROR",
"maxAgeSeconds": 86400,
"timeoutSeconds": 30,
"delaySeconds": 0,
"sequence": 99
}
}

Two rules make the file portable:

  • References are codes, not ids. Ids differ between environments, so a subscription names its connection by connectionCode, its pool by dispatchPoolCode, its application by applicationCode and its client by clientIdentifier. The import matches those against this environment’s records.
  • No secrets. Signing secrets, auth tokens and client secrets are never exported, and neither are ids, status, timestamps or createdBy. A service account you import gets fresh credentials when you create it.

Keys with no value are omitted; 0 and false are kept. The keys per kind:

Kind Keys
application code, name, description, type, defaultBaseUrl, iconUrl, website, logo, logoMimeType
service-account code, name, description, scope, clientIdentifiers, applicationCode, roles
connection code, name, description, externalId, serviceAccountCode, clientIdentifier
dispatch-pool code, name, description, rateLimit, concurrency, clientIdentifier
subscription code, applicationCode, name, description, endpoint, clientScoped, clientIdentifier, eventTypes, connectionCode, queue, dispatchPoolCode, mode, maxAgeSeconds, timeoutSeconds, delaySeconds, sequence

Copy in dependency order, because references are matched by code in the target:

  1. Applications and event types (event types arrive with the application’s sync).
  2. Service accounts.
  3. Connections (which name a service account).
  4. Dispatch pools.
  5. Subscriptions (which name a connection and a pool).

Remember that a subscription’s endpoint is copied as it is. If production should deliver to a different URL from QA, change it in the form before you press Create.

None. The feature adds no endpoint. The console builds the file from data the drawer already has, and the create form fills itself in. If you need scripted promotion between environments, use the SDK sync calls (Declare definitions in code).