Programmatic integration
Choose the integration boundary
| Need | Use |
|---|---|
| Transform or validate data inside a workflow | Code node |
| Retrieve or update an application record | Reader or Writer API operation |
| Run a workflow without the visual editor | Headless runner |
| Start a workflow from another service | Authenticated headless webhook |
These are implemented product interfaces. A separate client library is not required to call an external application's API from a workflow.
A Code node example
Code nodes receive and emit slots using zero-based indexes. This example prepares an order-review result from an object arriving on UI slot 1:
const order = inputs.get(0);
if (!order || typeof order !== "object") {
throw new Error("Expected an order object on slot 1");
}
const missing = ["orderId", "customerId"].filter(key => !order[key]);
outputs.set(0, {
orderId: order.orderId ?? null,
needsReview: missing.length > 0,
missingFields: missing
});Connect the output to a Decision node that routes records requiring review separately from complete records. A thrown error is an execution failure; use an explicit output value when you want a business exception to continue down a review branch.
Invoke from your own application
Use the commands and trigger options in Headless execution and Webhooks. Your surrounding service should authenticate callers, validate payloads, track job identifiers and retain the outputs needed by its users.
NodeFox does not currently publish a JavaScript SDK with client.workflows.run or client.runs.get methods. If you create a typed wrapper, document its contract separately from the runner and test invocation errors independently from workflow errors.