Chaque étape d'un workflow exécute une action. Les paramètres peuvent être des valeurs fixes ou des expressions ; le résultat arrive dans steps.<stepId>. Les actions de contrôle du flux (branch, switch, loop, parallel, try/catch, stop, log) fonctionnent aussi bien dans les workflows client que serveur.
Actions client
Données
| Action | Paramètres | Résultat |
|---|---|---|
Set variablecore.setVarSets a variable, or a dotted path inside it (filters.category). | var Variable name or path, without vars.value New value. | The value that was set. |
Reset variablecore.resetVarRestores a variable to its default value. | var Variable name or path. | The value after the reset. |
Refetch querycore.refetchRuns a client query again and waits for it. | query Query name. | The query state after the run (data, error, updatedAt). |
Run operationcore.runOperationNot available in client workflows: plugin operations need secret keys and run in server workflows. | integrationId Integration id.operation Plugin operation id, e.g. rest.request.input? Operation input. | Nothing: the step always fails in a client workflow. |
Run server workflowcore.runServerWorkflowRuns a server workflow called from pages (plugin operations, tables, emails) and waits for its result. | workflow Server workflow with the trigger "Called from pages".input? Becomes input in that workflow. | The value of its Return step. |
Flux de contrôle
| Action | Paramètres | Résultat |
|---|---|---|
If / elsecore.branchRuns then when the condition is truthy, otherwise else. | if Condition.[then] liste d'étapes[else] liste d'étapes | The branch that ran: "then" or "else". |
For eachcore.loopRuns body once per item, with item and index in scope (outer loop row in parent). At most 1000 items. | items An array (null or undefined runs zero times).[body] liste d'étapes | The number of iterations. |
Try / catchcore.tryCatchRuns try; if a step fails, runs catch with error in scope. Limits and cancellation are not caught. | [try] liste d'étapes[catch] liste d'étapes | { ok: true }, or { ok: false, error } when catch ran. |
Switchcore.switchRuns the steps of the first case whose value equals value, otherwise default. | value Value to match.cases? Cases { id, label, equals } (at most 32); each id is a branch.[default] liste d'étapes | The id of the case that ran, or "default". |
Run in parallelcore.parallelRuns every lane at the same time and waits for all (at most 8 lanes). A failing lane fails the step. | — | { a: true, b: true, … } once every lane finished. |
Breakcore.breakLeaves the nearest For each loop. Only inside a loop body. | — | Nothing. |
Continuecore.continueSkips to the next item of the nearest For each loop. Only inside a loop body. | — | Nothing. |
Waitcore.delayWaits a number of milliseconds (at most 60000). | ms Duration in ms. | The milliseconds waited. |
Stopcore.stopEnds this workflow successfully. Later steps do not run. | — | Nothing. |
Run workflowcore.runWorkflowRuns another workflow of the page and waits for it (call depth at most 8, no cycles). | workflow Workflow id.input? Becomes input in the called workflow. | The called workflow's step results (steps). |
Navigation
| Action | Paramètres | Résultat |
|---|---|---|
Go to pagecore.navigateNavigates to a page of the site or a URL. | to A page ({ pageId }), a path (/about) or an http(s) URL. | Nothing. |
Open URLcore.openUrlOpens a URL (http, https, mailto, tel or a relative path). | url URL to open.newTab? Open in a new tab. | Nothing. |
Interface
| Action | Paramètres | Résultat |
|---|---|---|
Show toastcore.toastShows a short notification. | message Text to show.variant? Style. | Nothing. |
Scroll to elementcore.scrollToScrolls an element into view. | node Node id.behavior? Scroll behavior. | Nothing. |
Copy to clipboardcore.copyToClipboardCopies text to the clipboard. | text Text to copy (non-strings are JSON-encoded). | Nothing. |
Play interactioncore.playInteractionPlays an interaction (animation) of the page. | interaction Interaction id. | Nothing. |
Comptes visiteurs
| Action | Paramètres | Résultat |
|---|---|---|
Log in visitorcore.loginSigns a site visitor in with email and password and updates user. Site publié uniquement. | email Visitor email.password Visitor password (bind it to a form field). | The signed-in user. |
Sign up visitorcore.signupCreates a visitor account, signs it in and updates user. Site publié uniquement. | email Visitor email.password New password.name? Display name. | The new user. |
Log out visitorcore.logoutSigns the visitor out and resets user. Site publié uniquement. | — | null. |
Send sign-in linkcore.sendMagicLinkEmails the visitor a one-time sign-in link (same answer whether or not the account exists). Site publié uniquement. | email Visitor email. | true. |
Refresh usercore.refreshUserReloads the signed-in visitor into user. Site publié uniquement. | — | The signed-in user, or null. |
Débogage
| Action | Paramètres | Résultat |
|---|---|---|
Logcore.logWrites a value to the run log (the browser console on the published site). | value Value to log. | The logged value. |
Actions réservées au serveur
Disponibles dans les workflows serveur, avec des nouvelles tentatives facultatives pour chaque étape.
| Action | Paramètres | Effet |
|---|---|---|
HTTP requestcore.httpRequest | url, method, headers, body | Appelle une URL HTTPS externe depuis le serveur (pas d'adresses privées, 15 s, 1 Mo). |
Send emailcore.sendEmail | to, subject, text, html | Envoie un e-mail transactionnel. |
Run operationcore.runOperation | integrationId, operation, input | Exécute une opération d'intégration avec ses secrets. |
Run server workflowcore.runServerWorkflow | workflow, input | Exécute un autre workflow serveur et attend son résultat. |
Run JavaScriptcore.runJs | code, input | Exécute du code dans un bac à sable, avec l'entrée et les étapes dans la portée ; sans réseau, liaisons ni secrets. |
Returncore.return | value | Termine l'exécution avec un résultat ; pour les points de terminaison, c'est le corps de la réponse. |
Query tablecore.tableQuery | table, filter, limit, cursor | Lit les lignes d'une table native. Résultat : { rows, nextCursor }. |
Get rowcore.tableGet | table, id | Lit une ligne à partir de son id. |
Insert rowcore.tableInsert | table, values | Insère une ligne. |
Update rowcore.tableUpdate | table, id, values | Met à jour une ligne. |
Delete rowcore.tableDelete | table, id | Supprime une ligne. |
Set visitor rolescore.visitorSetRoles | userId, roles | Remplace les rôles d'un visiteur. Les rôles doivent exister dans le site. |
Sleepcore.sleep | duration | Met l'exécution en pause, par exemple "5 minutes". Rend le workflow durable. |
Wait for eventcore.waitForEvent | event, timeout | Met en pause jusqu'à l'arrivée d'un événement de ce type ; le résultat est sa charge utile. Durable. |
Emit eventcore.emitEvent | runId, type, payload | Reprend une exécution qui attend ce type d'événement. |