A channel can carry a binding: every player/server message published on it also triggers a FlowFn automation. The automation receives one stable payload — the stream code, room, channel, sender (id, name, role), the message payload, and a timestamp.
Run a workflow
Each message starts a normal workflow run (billed like any run) with the message as trigger inputs — filter the Runs page by the stream trigger to see them. Set the binding's Reply channel and the room hears the outcome when the run finishes: a workflow_run event carrying the result on success or the error message on failure, so your game can react without polling. Leave it on No reply for fire-and-forget. Very large results are truncated in the room event — fetch the run itself when you need the full output.
Run a stream function
Every stream has a Code tab — write exported functions there and bind a channel to one (the binding dialog can generate a ready-to-edit stub). The function runs on FlowFn with ctx.workflows, ctx.agents, ctx.http, ctx.ai.call(message, { system, max_tokens }) (a one-shot AI reply on your team's own model, billed to your AI credits — returns { text, ... }), ctx.sheets(databaseId) (read/write your data sheets — insertRow / updateRow / query / getRow / deleteRow, naming the database per call; ownership-checked against your team), and ctx.streams.publish(stream, room, channel, payload) to answer the room — including on FlowFn-authority channels players can hear but never write. FlowFn-side publishes never re-trigger bindings, so a function publishing into its own channel cannot loop. Everything your function prints with console.log — and any error it throws — appears in the stream's Recent activity feed, which is the place to look when a binding "didn't work".
Ask a streaming agent
Bind a streaming-type agent and it answers the room as an in-game character — an NPC, a referee, a hint-giver. Each room keeps its own conversation memory, replies publish on the binding's reply channel (usually a FlowFn-only channel), and a per-room cooldown keeps a busy room from running up cost. If the agent replies with JSON, your game receives it as structured data — the easiest way to drive NPC actions.
Call AI
The quickest way to put AI in a room — no agent, no workflow, no code. Bind a channel to Call AI, write a system prompt (the persona/instructions), and every player message runs your team's own configured AI model; the reply publishes back on the binding's reply channel. Set a max reply tokens cap and a per-room cooldown (defaults to a couple of seconds, since each call spends AI credits). It's billed to your team's AI credit pool with the same balance and monthly limits as every other AI feature, and like an agent reply, JSON the model returns arrives as structured data. For more control from inside your own code, a stream function can call ctx.ai.call(message, { system, max_tokens }) directly — same model, same billing.
Editing live
Channel and binding changes apply to already-connected clients within a moment of saving — no reconnect needed. The activity feed logs every skipped or failed binding with the reason (missing workflow, plan gate, cooldown, code error), so misconfigurations surface instead of failing silently.