PlanewardPlaneward Docs
PlanewardPlaneward Docs
Welcome

Developers

REST APIAuthenticationWebhooksMCPEmbedded projectsTask description contentDeveloper hub
WorkflowsExpressions

API

Workflows

Expressions

Paths, templates, and copy-paste examples for workflow fields.

How to write input, outputs["…"], and {{ }} in a workflow. Building and activating a graph: Workflows.

Two places to write them:

  • Expression fields (If, Switch, Conditions, Foreach) — a JS-like expression, no braces.
  • Template fields (titles, IDs, HTTP URL/body, channel message, Log) — wrap the same expression in {{ }} so it interpolates into text.

Click a node, then use the Input panel. Drag a field into the inspector instead of typing paths by hand. Edit the trigger’s test payload JSON so the tree matches what a live run will send.

input and trigger are the same object — the trigger payload. Previous steps show up as outputs["Node label"].

What you can read

Write thisYou get
input / triggerThe trigger payload
outputs["Create task"]That node’s result (the label on the node)
outputs["AI Agent"].textText-mode reply from an AI Agent
outputs["AI Agent"].objectStructured fields from an AI Agent
vars.item / vars.indexThe current Foreach item and index
nowCurrent time (a date)
secret("STRIPE_SECRET")A value from Workflows → Secrets

Node labels with spaces need quoted brackets: outputs["HTTP Request"].status. Renaming a node changes the key — update expressions that point at it.

Event payloads are small. Use Get task / Get invoice / Get submission when you need the rest of the record. The live data shapes are on Workflows.

Trigger payloads

Manual (default test payload):

input.source; // "manual"
input.data;

Task created (and other platform events):

input.event; // "task.created"
input.data.id;
input.data.projectId;
input.data.title;
input.timestamp;

Task updated (and every other *.updated event) — see Updated events:

input.data.id;
input.data.projectId;
input.data.old.statusId;
input.data.new.statusId;
input.data.changes; // ["statusId", "completedAt"]

Inbound webhook — input.body is the JSON you POSTed:

input.body.email;
input.body.items;
input.headers["content-type"];

Schedule — live runs send the fire time only:

input.scheduledAt; // "2026-08-29T09:00:00.000Z"

Updated events

*.updated triggers send { id, <parent ids>, old, new, changes }. old and new hold only the fields that changed; changes lists their names. A field that did not change is missing from both.

Write thisYou get
trigger.data.old.<field>The value before the change
trigger.data.new.<field>The value after the change
trigger.data.changesNames of the changed fields, such as title

Status changed to Done — an If after a Task updated trigger. Use your Done status id from the project (or planeward-project-status-list):

trigger.data.changes.includes("statusId") &&
  trigger.data.new.statusId === "status_done";

Other checks:

trigger.data.changes.includes("dueDate"); // due date moved
trigger.data.old.priority !== "URGENT" &&
  trigger.data.new.priority === "URGENT";
trigger.data.new.title; // only set when the title changed

In a template: Renamed {{ trigger.data.old.name }} to {{ trigger.data.new.name }}.

Update saved workflows

Workflows saved before this change are not migrated. On an *.updated trigger, trigger.data.<field> (for example trigger.data.title or input.data.statusId) no longer exists. Change it to trigger.data.new.<field>, trigger.data.old.<field>, or trigger.data.changes. For a field that may not have changed, use Get task (or the matching Get node) with trigger.data.id.

Templates

Titles, URLs, message bodies, and IDs are templates. Plain text stays as-is. Each {{ … }} is evaluated and spliced in.

Follow up: {{ input.data.title }}
https://api.example.com/invoices/{{ input.data.id }}
Overdue {{ outputs["Get invoice"].title }} ({{ outputs["Get invoice"].amount }})
Posted at {{ now.toISOString() }}
Authorization: Bearer {{ secret("OPENAI_API_KEY") }}

In an If / Switch / Foreach field, drop the braces:

input.data.title.includes("urgent");
outputs["HTTP Request"].ok;

Pasting input.data.id into a template field wraps it as {{ input.data.id }} for you.

Paths

Dot through normal keys. Use quoted brackets for spaces, dashes, or anything that is not a name:

input.data.title;
input.data.status === "open";
outputs["Create task"].id;
outputs["Get invoice"].customerId;
input.headers["content-type"];
input.body.items["0"].sku;

Brackets must be a quoted string. input.items[0] is rejected — write input.items["0"].

input and trigger are aliases. These are the same:

input.data.title;
trigger.data.title;

If, Conditions, Switch, Foreach

If — one expression. Truthy goes down the true handle.

input.data.title.includes("urgent");
input.event === "invoice.paid";
outputs["Get invoice"].status === "overdue";
outputs["HTTP Request"].status >= 400;
input.event === "task.created";

Conditions — first matching branch wins. Typical ladder:

input.data.status === "open";
input.data.status === "done";
true;

Switch — one discriminant, then case strings. The match is compared as text (2 matches "2").

Discriminant:

input.data.status;
input.kind;
outputs["Get invoice"].status;

Cases: open, done, overdue. Unmatched values take the default handle.

Foreach — items expression must evaluate to an array. Non-arrays become an empty loop.

input.body.lineItems;
input.items;
outputs["HTTP Request"].body.results;

Inside the loop body, the item variable (default item) and index (default index) live on vars:

{
  {
    vars.item.name;
  }
}
{
  {
    vars.item.email;
  }
}
{
  {
    vars.index;
  }
}

After the loop those vars are gone. Use them only on nodes hanging off the loop handle.

Comparisons and helpers

a === b;
a !== b;
a == b; // loose
a != b;
a > b && a >= b;
a < b || a <= b;
!flag;
a + b - (((c * d) / e) % f);
cond ? yes : no;

Strings (only these methods):

input.data.title.includes("urgent");
input.data.title.startsWith("Re:");
input.data.email.endsWith("@acme.com");
input.data.title.toLowerCase() === "blocked";
input.data.notes.trim() !== "";

Dates — now, plus allowlisted methods:

now.getFullYear();
now.getMonth();
now.getDate();
now.getDay();
now.getHours();
now.toISOString();
now.getTime();

Combine them:

input.data.status === "open" && input.data.title.includes("VIP");
input.event === "task.created" || input.event === "task.updated";
input.data.title.startsWith("Re:") ? "reply" : "new";
outputs["Get invoice"].amount >= 50000 &&
  outputs["Get invoice"].status === "overdue";

Invoice status is draft, pending, overdue, or paid. amount is integer cents (50000 is $500).

There is no assignment, no comments, no function, no globalThis. Unknown names fail the run.

Secrets

Store values under Workflows → Secrets. Reference one name at a time — there is no secrets dump.

{
  {
    secret("STRIPE_SECRET");
  }
}
{
  {
    secret("OPENAI_API_KEY");
  }
}

Prefer the credential picker on HTTP Request for Authorization headers, or on an AI provider node for OpenAI / Anthropic. If you interpolate secret() into a URL, body, or Log message, that value can leave the workspace or show up in the run. Runs redact known secret strings in stored logs, but do not put keys in Log nodes.

Copy-paste recipes

Task created → follow-up task. Trigger: task created. Create task title:

Follow up: {{ input.data.title }}

Project and status: pick them in the inspector, or set project to {{ input.data.projectId }}.

Invoice event → load the invoice, then branch. Trigger: invoice created / updated / finalized. Get invoice id:

{
  {
    input.data.id;
  }
}

If:

outputs["Get invoice"].status === "overdue";

True path: Channel message.

{{ outputs["Get invoice"].title }} is overdue ({{ outputs["Get invoice"].amount }})

Inbound webhook → create a customer. Trigger: inbound webhook. Create customer:

{
  {
    input.body.name;
  }
}
{
  {
    input.body.email;
  }
}
{
  {
    input.body.company;
  }
}

Webhook list → one task per item. Foreach items: input.body.items. Create task title:

{
  {
    vars.item.title;
  }
}

Call an API, then branch on the response. HTTP Request URL:

https://api.example.com/invoices/{{ input.data.id }}

Body (POST):

{
  "title": "{{ input.data.title }}",
  "source": "planeward"
}

If: outputs["HTTP Request"].ok — or outputs["HTTP Request"].status === 200. Read JSON from outputs["HTTP Request"].body.

HTTP + secret header. Header name Authorization, value:

Bearer {{ secret("OPENAI_API_KEY") }}

Or attach a bearer / API-key secret on the node and skip the template.

Switch on invoice status after Get invoice. Discriminant: outputs["Get invoice"].status. Cases: draft, pending, overdue, paid.

Schedule → ping a channel. Trigger: schedule. Channel message:

Hourly check at {{ input.scheduledAt }}

Log while you test (then delete it):

event={{ input.event }} id={{ input.data.id }} title={{ input.data.title }}

AI Agent Structured → branch. After an AI Agent in Structured mode: If outputs["AI Agent"].object.priority === "urgent". Task title: {{ outputs["AI Agent"].object.title }}. Setup: AI Agent.

Next

  • Workflows
  • Webhooks

Workflows

Automate tasks, invoices, and messages with a graph.

List projects GET

Next Page

On this page

What you can readTrigger payloadsUpdated eventsTemplatesPathsIf, Conditions, Switch, ForeachComparisons and helpersSecretsCopy-paste recipesNext