Expose platform environment bindings to deterministic Action handlers #476
Divkix
started this conversation in
Feature Request
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem
defineAgent<TEnv>()initializers and Flue runtime contexts receive platform environment bindings, butActionContextexposes onlyharness,log, and optionalinput.This prevents a deterministic Workflow Action from calling narrow application-owned capabilities such as a Cloudflare Durable Object binding. Current workarounds are undesirable:
getCloudflareContext();A motivating case is a structured AI workflow that produces a recommendation, then invokes an application-owned durable coordinator by stable action ID. The coordinator owns authorization, idempotency, and external-effect attempts. Flue should orchestrate the call, but the model must never receive the binding or its secrets.
Proposed API
Expose platform bindings on Actions:
Ideally, thread the agent environment type through
ActionContext,ActionDefinition, andWorkflowDefinition, soenvis typed rather thanRecord<string, unknown>.Runtime behavior
A minimal proof works by:
ctx.envinto the Action context inexecuteWorkflowDefinition();envis trusted application capability state and is never serialized, logged, or exposed to the model automatically.The capability should behave consistently for inline Workflow Actions, extracted Actions, model-invoked Actions, Node environment values, and Cloudflare bindings.
Non-goals
This does not make Flue responsible for application authorization or effect idempotency, and it does not imply workflow checkpoint/resume semantics. Those remain explicit application concerns.
All reactions