Functions
A Function is a reusable operation with a name your code calls, such as send-email or
create-contact, and a fixed set of inputs. Behind it sits one implementation: an app action, another
Function or a Workflow. When you change provider, for example moving email from one vendor to
another, you re-bind the Function, and every caller keeps working without a code change.
Functions belong to your account and every project can use them.
Create a Function
- In the sidebar, under Build, click Functions.
- Click + New function. The New function dialog opens.
- Enter a Name, for example “Send Email”.
- Enter a Key, for example
send-email: lowercase, kebab-case, 3–39 characters. It becomes part of the address callers use, and you can’t change it later. - Optionally add a Description, then click Create.
How you know it worked: the Function’s editor opens, with an incomplete badge because nothing is bound yet.
Define its inputs
The Inputs card is the Function’s contract: what a caller sends.
- Click + Add input.
- Fill in its key (what callers send, like
to), a Label, and a type:string,text,number,boolean,jsonorsecret. Tick required if callers must always send it. - Repeat for each input.
Bind the implementation
- In the Implementation card, pick a Kind: Action (synchronous), Function (synchronous) or Workflow (asynchronous).
- For an action, click + Choose an action, then pick the app, the integration and the action.
- Under Input mapping, fill in each of the action’s parameters. Type
inputs.<key>to pass one of your inputs through, for exampleinputs.to. Anything else is a fixed value. Use the ƒx button for a variable, secret or document (see Expressions). - Click Save.
How you know it worked: Saved. appears and the incomplete badge is gone.
To change provider later, click Change in Implementation, pick the other app’s action, map the same inputs and save. The key and inputs stay the same, so callers don’t notice.
Test it
A Function must be published before it can be invoked, including from Test invoke.
- Save your edits.
- Open the Settings panel on the right-hand tool rail and click Publish (see Publish and versions).
- In Test invoke, fill in a value for each input and click Invoke.
How you know it worked: the result shows a status line (status · N ms · invocationId) above the
vendor’s answer. Find the call again under History.
Call it from code
const result = await client.functions.run("send-email", { payload: { to: "a@example.com" } });
See Node SDK.
w6w functions run send-email --payload '{"to":"a@example.com"}'
See CLI.
The Code panel on the tool rail gives the same call ready-made for Node, CLI, Python and curl.
Troubleshooting
| Symptom | Cause | What to do |
|---|---|---|
Can’t save yet — map … | A required action parameter has no value under Input mapping. | Map it to an input or give it a fixed value. |
| The incomplete badge stays | No action, Function or Workflow is bound. | Finish Implementation. |
Pick an app and action to test this function — it has no implementation bound yet. | Test invoke has nothing to run. | Bind an implementation and save. |
Invoking answers that it has never been published and cannot be invoked | You saved but never published. | Click Publish in the Settings panel. |
| The key is refused as taken | Another Function in your account already uses it. | Choose another key. |
Where to next
- Publish and versions: publish, roll back, disable or archive.
- The tool rail: rename, export, call from code and set error handling.
- Endpoints: give the Function a URL with its own authentication.