Skip to main content

Automation export and import

Move an automation (and the automations it calls) between companies or between installs: export it to a file, then import that file into the target company. Nothing is published automatically — the import always lands as a new, unpublished draft, so you review it before it runs anything.

What never travels​

The file never carries a secret and never carries an id that would be meaningless on another company. Every integration install, saved credential, data table, team chat room, campaign, WhatsApp channel, company number, extension, queue, ring group and flow HTTP secret the automation names goes out as a reference: its kind and its display name only, never its id and never a secret value. A credential's password, a flow HTTP secret's value and the content of an API key are not in the file at all — only the saved credential's own name, and the secret's own name, so the target company's administrator can tell what to reconnect.

Export​

Open Admin > Call handling > Flows, and choose Export from a call flow's or an automation's row menu. The download is one JSON file: the flow's current graph (its newest draft, or its live version when it has no draft), every automation it calls (through a Start another automation step, or a transfer to another flow), and the references above.

To export several at once, or to script it, use the API:

# One flow
curl -H "Authorization: Bearer <token>" \
https://pbx.example.com/api/v1/call-flows/<flow id>/export -o flow.json

# Several, as a zip of one document per flow
curl -X POST -H "Authorization: Bearer <token>" -H "Content-Type: application/json" \
-d '{"ids": ["<flow id 1>", "<flow id 2>"]}' \
https://pbx.example.com/api/v1/call-flows/export-bulk -o flows.zip

Both need the permission to view call flows.

Import​

Open Admin > Call handling > Flows > Start from > Import a flow, pick the exported file, and look at the mapping report before importing: for every reference, it says whether this company already has a matching item under the same name (Ready), whether this build can create one for you (Will be created — today only a missing data table, from the schema the file carries, and a called automation, from its own graph in the file), or whether it is Missing. A missing reference means an administrator must set that up on this company first — connect the integration, save the credential, create the number, add the user, create the chat room or campaign, connect the WhatsApp channel, or re-enter the flow HTTP secret under the same name — then upload the file again.

Importing needs the permission to change call flows. The console imports one file at a time; POST /api/v1/call-flows/import/dry-run and /import/apply take the same document (JSON or YAML) for scripting:

DOC=$(cat flow.json)
curl -X POST -H "Authorization: Bearer <token>" -H "Content-Type: application/json" \
-d "{\"document\": $(jq -Rs . <<< "$DOC")}" \
https://pbx.example.com/api/v1/call-flows/import/dry-run

curl -X POST -H "Authorization: Bearer <token>" -H "Content-Type: application/json" \
-d "{\"document\": $(jq -Rs . <<< "$DOC")}" \
https://pbx.example.com/api/v1/call-flows/import/apply

/import/apply's mapping lets a script point a reference at an existing item by id (or, for a number, by the number itself) instead of relying on the name match — useful when the target company's item has a different name. A document with an unknown node type, or a schema version newer than this build reads, is refused with a clear error instead of a silent partial import.

The import always creates new flows: a called automation is never matched to an existing one, even by name, so a stray automation of the same name on the target is never changed. Rename or remove the extra copy afterward if you do not want it.

What is not carried yet​

An office-hours schedule (the Hours step) and a dial-by-name directory's department filter still travel as literal ids, which are unlikely to match on another company: fix those steps by hand after importing. Only one document at a time can be imported from the console today; a zip of several is exported from the console list already, and can be imported today by uploading each file in it in turn, or through the API.