blocks-workflow
Skill42 starsChanged 12 days agoMITView on GitHub
Design SELISE Blocks Workflows and manage them from the terminal with `blocks logic workflow list|get|save|delete|import|export|publish|unpublish`. Covers authoring a workflow graph as JSON (triggers, if/code/set-field, http/data/mail actions), importing it into a project with `logic workflow import [--publish]`, exporting with secrets redacted, and activating with `logic workflow publish`. Use to build event-driven backend logic — data triggers, webhooks, schedules — without standing up a separate backend, and to judge when a workflow is the right tool versus when it is not. Not for runtime record CRUD (blocks-data-gateway-crud) or sending mail from app code (blocks-mail).
In this repository27 other files it gives its agents.
- AGENTS.mdAGENTS.md
- bootstrap/agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- blocks-bootstrapSkill
- blocks-captchaSkill
- blocks-data-gateway-configurationSkill
- blocks-data-gateway-crudSkill
- blocks-data-storageSkill
- blocks-frontend-local-httpsSkill
- blocks-functionsSkill
- blocks-iam-access-controlSkill
- blocks-iam-accountSkill
- blocks-iam-mfaSkill
- blocks-iam-organizationsSkill
- blocks-iam-sso-oidc-configurationSkill
- blocks-iam-sso-oidc-implementationSkill
- blocks-iam-usersSkill
- blocks-localization-configurationSkill
- blocks-localization-implementationSkill
- blocks-mailSkill
- blocks-notificationSkill
- blocks-notifierSkill
- blocks-proxySkill
- blocks-release-deploymentSkill
- blocks-secretsSkill
- blocksSkill
- blocks-storage-configurationSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 6
When invoking a project-scoped blocks command, either use the resolved account's saved selection or pass --project <tenantId> for that one …
- Distinctive: line 20
Run work on a schedule (cron).
- Distinctive: line 23
Do not use a workflow for:
- Distinctive: line 31
When it's a close call, prefer the smallest thing that works: a rule or an SDK call over a workflow, and a workflow over a new backend …
- Very specific: line 45
All workflow commands are project-scoped (they use the resolved project selection or --project <tenantId>).
- Very specific: line 73
versionis always"v1": Don't invent other version strings. - Very specific: line 75
Dropped nodes/edges are reported, not fatal: Import counts and skips malformed nodes and dangling edges.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
When invoking a project-scoped blocks command, either use the resolved account's saved selection or pass --project <tenantId> for that one command without changing saved state.
Blocks Workflow
For CLI work, use blocks-bootstrap first when account or project context is unknown. Workflow commands must not choose or repair authentication context as a side effect.
A workflow is a graph of nodes that runs on the Workflow service. It exists so an app can get backend behaviour — react to data changes, expose a webhook, run on a schedule, call other services — without standing up a separate backend app. The whole surface is CLI + JSON: there is no SDK for authoring workflows (a deployed app never edits its own workflows). This skill is how an agent designs a workflow and loads it into a project.
Decide first: is a workflow the right tool?
Reach for a workflow when the job is event-driven glue that would otherwise need a backend service:
- React to Data Gateway changes — on insert/update/delete of a collection, do something (the
dataGatewaytrigger). - Expose a webhook endpoint that orchestrates several Blocks calls (IAM, Data, Mail, Storage) behind one URL.
- Run work on a schedule (cron).
- Conditional fan-out / light integration with an external API: call, transform, branch, write back.
Do not use a workflow for:
- Pure UI/frontend logic, or a single call the app can make inline with the SDK (that's blocks-data-gateway-crud, blocks-mail, etc.).
- Heavy, long-running, or high-throughput compute; anything needing libraries beyond the Code node's JavaScript sandbox.
- Strong-consistency, transactional multi-step logic.
- Low-latency synchronous request paths where an extra hop matters.
- Something a Data Gateway validation rule or an IAM permission already enforces.
When it's a close call, prefer the smallest thing that works: a rule or an SDK call over a workflow, and a workflow over a new backend service.
The authoring model
A workflow file is exactly { name, settings, nodes[], edges[] } — the same shape the portal's editor exports and imports, so a file exported from one project imports into another.
- nodes[] — each node has
id,name,category(trigger|logic|transform|action),type,version(always"v1"),position:{x,y}, and aparametersobject whose fields depend on the type. - edges[] —
{ id, source, target, sourceHandle, targetHandle }wire node outputs to inputs. Every node emits fromsourceexcept theifnode, which has two handles:if-trueandif-false. - expressions — parameters interpolate upstream data with
{{$json.field}}(the current item),{{$node["Node Name"].json.field}}(a named upstream node), and$itemsfor the full set inside a Code node.
There are 12 node types. The full catalogue — every type, its exact parameters fields, allowed values, and output handles — is in references/nodes.md. Two complete, annotated real workflows (a webhook orchestration and a data-trigger side-effect) are in references/examples.md. Read those before hand-writing a graph.
Command surface
All workflow commands are project-scoped (they use the resolved project selection or --project <tenantId>). Reads take no confirmation; every mutation takes --dry-run first, then --yes.
blocks logic workflow list [--search <q>] [--is-published[=false]] [--page-number 1] [--page-size 20] [--json]— read-only.blocks logic workflow get <id> [--json]— read-only; returns the full node/edge graph.blocks logic workflow import --file <path.json> [--publish] [--project-slug <slug>] [--name <n>] [--dry-run] [--yes] [--json]— the main authoring path. Validates the file, assigns fresh node ids, rewrites edges, and re-points tenant-scoped keys at this project. It upserts by name (updates a same-named workflow, otherwise creates), never trusting the file's own id.--publishactivates it in the same step.blocks logic workflow export [<id>] [--all] [--include-secrets] [--out <path>] [--out-dir <dir>] [--json]— writes portable JSON thatimportcan consume. Redacts secrets by default.blocks logic workflow save [--item-id <id>] [--name <n>] [--description <d>] [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]— low-level create/update from a payload; omit--item-idto create, pass it to update. A create with nodes runs as an emptyWorkflow/Createfollowed by aWorkflow/Updateof the graph (Create rejects node parameters server-side); a failed Update deletes the empty workflow. Preferimportfor whole exported files (it does the id-remap and tenant rewrite;savedoes not).blocks logic workflow publish <id> [--name <n>] [--description <d>] [--dry-run] [--yes] [--json]— publishes a new version, which is what actually activates the workflow: its webhook becomes reachable and schedule triggers are registered.blocks logic workflow unpublish <id> [--dry-run] [--yes] [--json]— takes it out of service; the draft is kept, re-publish to reactivate.
The normal loop is: design the graph → write the JSON → logic workflow import --file ... --dry-run → --yes → logic workflow publish. See flows/author-and-import.md.
Secrets
A workflow export embeds live credentials in cleartext — client secrets, the x-blocks-key header value, composite client credentials sit inside node parameters. Two consequences:
- Export redacts by default.
workflow exportreplaces those values with__REDACTED__. Use--include-secretsonly when you deliberately want a runnable copy, and never commit that file. - Prefer delegated auth over embedded secrets when authoring. For
httpRequest/dataActionnodes calling Blocks services, useauthenticationType: "blocksAuthentication"(a delegated token, no stored secret) instead ofclientCredentialwith a hard-coded id/secret wherever the call allows it. If a file still carries__REDACTED__placeholders,importwarns — fill them in before the workflow will run.
Mutation discipline
import, save, delete, publish, unpublish all mutate. Same two gates as the rest of this CLI: --dry-run prints exactly what would happen and makes no network call; without it, either --yes or an interactive "yes" is required. Always dry-run first. list/get/export never mutate the server.
Gotchas
- A created or imported workflow is inactive. It won't run until
logic workflow publish. Import with--publishto do both at once. - Import matches by name, not id. A file's node/workflow ids belong to whatever project produced it;
importassigns fresh ids and finds the destination workflow by name. Two workflows you want kept separate must have different names. - Tenant-scoped nodes get re-pointed on import.
dataAction,dataGateway, andsendMailnodes have theirprojectKeyset to the destination project automatically;sendMailtemplates are namespaced per tenant. AprojectShortKeyreference can only be updated if you pass--project-slug <slug>— otherwiseimportwarns and leaves it. versionis always"v1". Don't invent other version strings; the engine matches nodes bytype, and every real node isv1.- The
ifnode is the only branch. Wire itsif-true/if-falsehandles; all other nodes flow fromsource. - Dropped nodes/edges are reported, not fatal. Import counts and skips malformed nodes and dangling edges; check the
issues/warningsin the output.
Example trigger prompts
- "When a row is added to the Orders collection, call our fulfilment API." → a
dataGateway(Inserted) trigger →httpRequestaction; author JSON,logic workflow import --file ... --publish --dry-run, then--yes. - "Give me a webhook that creates a user only if we're under our seat limit." →
webhooktrigger →httpRequest/code/if→httpRequestcreate; see references/examples.md. - "Email a daily summary every morning." →
scheduletrigger →dataActionread →sendMail. - "Should this be a workflow or app code?" → apply the decision list above; a single SDK call or a data rule is usually better than a workflow.
- "Back up all our workflows to the repo." →
blocks logic workflow export --all --json(secrets redacted by default). - "Move this workflow to the staging project." →
blocks logic workflow export <id>, then in the staging projectblocks logic workflow import --file <path> --project-slug <slug>. - "Turn this workflow off without deleting it." →
blocks logic workflow unpublish <id> --dry-run, then--yes.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

