Export and import
Any workflow can be saved as a file and imported into another project or workspace. Use it to keep workflows in Git, to move a workflow from a test project to the real one, or to share one with a colleague.
Files are YAML (.blokkio.yaml, the default, easy to read and review) or JSON (.blokkio.json, for scripts).
Both hold the same thing.
Exporting a workflow
- From the workflow list: ⋯ → Export… on the workflow's row.
- From the editor: ⌄ next to Publish → Export…, or search for Export workflow with Ctrl/⌘ K.
Choose the format and the version: the draft (your latest saved changes) or any entry of its version history, such as the live version. Then select Download.
The editor exports what is saved. Wait for Saved in the header before exporting a draft you've just changed.
What's in the file
A file holds the workflow's name, description and tags, its steps with their settings, the links between steps, sticky notes, the run settings, and a list of the blocks, apps and building blocks (with their versions) the workflow uses.
No passwords or keys ever leave Blokkio in a file:
-
A connection is named by its app and name, never by its sign-in details:
connectionId:connection:app: slackname: Team Slack -
A secret stays a reference by name:
$secrets.SLACK_TOKENin expressions,secret: $secrets.SLACK_TOKENin a step's secret setting. Its value is never exported. -
Data tables, knowledge bases, AI tools, code packages and other workflows a step points at are named, not identified:
ref: { type: dataTable, name: Orders }. -
Pinned data, test data and run results are left out, and so are uploaded files (such as a form's logo).
-
Steps are identified by their names (the same names
$nodes['Step name']expressions use), so a file has no ids from your project.
A shortened example:
# Blokkio workflow: New order alert
schemaVersion: 2
kind: workflow
name: New order alert
tags: [sales]
settings:
timeZone: Europe/London
steps:
- name: New order
block: { id: 3bf79ce6-2506-48aa-b6b1-d39b1a705e26, version: "1", name: Webhook Trigger }
kind: trigger
position: { x: 0, "y": 0 }
settings: {}
- name: Tell the team
block: { id: 4d7a2c91-5e3b-4f08-9a6d-1b2c3e4f5a60, version: "1", name: App Action }
position: { x: 300, "y": 0 }
settings:
app: slack
action: send_message
connectionId: { connection: { app: slack, name: Team Slack } }
inputs:
channel: "#sales"
text: "New order {{ $nodes['New order'].body.id }}"
links:
- from: New order
to: Tell the team
A link leaves from a step's first output unless it says otherwise (fromPort: false for the false branch of an
If/Else, fromPort: error for an error route).
Importing a workflow
- Open Workflows and select Import (or Import a file in an empty project).
- Drop the file on the window, or choose it. Nothing is saved yet: Blokkio checks the file and shows a preview.
- Check the preview:
- What it creates: the workflow's name and its steps.
- Connections: for each connection the file names, pick one of this project's connections. Blokkio picks one for you when the project has a connection of the same app with the same name, or only one connection of that app. Choose Leave empty to connect it later: the editor marks the step until you do.
- Set up after importing: secrets the steps read that this project doesn't have (create them under Secrets with the same name), apps or building blocks that aren't added yet, and data tables or other items with no match.
- If the project already has a workflow with the same name, choose:
- Create a copy (the default): a new workflow named Name (2).
- Replace the draft of Name: the file's steps become that workflow's draft. Its version history keeps the draft it had (Before a restore), the live version keeps running, and nothing is published. Publish when you're ready. The workflow keeps its own name, tags and run settings.
- Select Import. The new draft opens in the editor.
Importing needs the Contributor or Administrator role. Viewers can export.
Everything in a file is re-created for the project you import into: steps get new ids, and a step is only linked to a connection or item of this project. An id from somewhere else is never kept.
When an import is refused
- The file can't be read: it isn't valid YAML or JSON, or it is larger than 2 MB. The message shows the line.
- A field is unknown or has the wrong type: the message names the step and the field, for example Step “Tell the team” has a field Blokkio doesn't know: “setings”. Fix the file and import it again.
- A step uses a block this workspace doesn't have, or a version of a block it doesn't have: remove the step from the file or export the workflow again from an up-to-date workspace.
- The file was exported by a newer version of Blokkio: files carry a
schemaVersion. Blokkio reads its own version and every older one (older files are upgraded on the way in), but refuses newer ones.
Keeping workflows in Git and CI
The public API exports and imports with a project API key:
| What | Request | Scope |
|---|---|---|
| Export | GET /api/v1/workflows/{workflowId}/export?format=yaml (or json; revisionId for a version) | workflows:read |
| Import | POST /api/v1/workflows/import | workflows:write |
Post the file as it is. Add ?dryRun=true to see the preview without importing, and ?conflict=replace to replace
the draft of the workflow with the same name (a deploy from Git that never publishes by itself):
# Save the workflow in your repository
curl -H "Authorization: Bearer $BLOKKIO_API_KEY" \
"https://api.blokkio.com/api/v1/workflows/$WORKFLOW_ID/export" -o workflows/orders.blokkio.yaml
# In CI: check the file, then update the draft
curl -X POST -H "Authorization: Bearer $BLOKKIO_API_KEY" -H "Content-Type: application/yaml" \
--data-binary @workflows/orders.blokkio.yaml "https://api.blokkio.com/api/v1/workflows/import?dryRun=true"
curl -X POST -H "Authorization: Bearer $BLOKKIO_API_KEY" -H "Content-Type: application/yaml" \
--data-binary @workflows/orders.blokkio.yaml "https://api.blokkio.com/api/v1/workflows/import?conflict=replace"
The response has the preview (connections, secrets, apps, building blocks, errors and warnings) and, unless it
was a dry run, the workflow. To link connections yourself, send a JSON body instead:
{ "content": "<the file>", "connections": { "slack/Team Slack": "<connection id>" } } (a null id leaves the
steps unconnected).
Every export and import is recorded in the audit log (Workflow exported, Workflow imported).
:::note Not in a file
One file holds one workflow. Environment-specific values don't belong in it: use
environments and $vars for values that differ between test and production.
:::