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.
What can be copied
Section titled “What can be copied”| 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.
Export
Section titled “Export”- Open the record’s drawer (View details).
- Choose Export JSON. The JSON appears read-only with Copy and Download. The download is named
<kind>-<code>.json, for exampleconnection-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.
Import
Section titled “Import”- In the other environment, open the same kind’s page and choose the create button.
- Choose Import from JSON at the top of the form, paste the JSON or pick the file, and submit.
- 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).
The notice
Section titled “The notice”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.
What is in the file
Section titled “What is in the file”{ "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 bydispatchPoolCode, its application byapplicationCodeand its client byclientIdentifier. 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 |
Order matters
Section titled “Order matters”Copy in dependency order, because references are matched by code in the target:
- Applications and event types (event types arrive with the application’s sync).
- Service accounts.
- Connections (which name a service account).
- Dispatch pools.
- 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.
Via the API
Section titled “Via the API”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).