Repository navigation
Replies: 1 comment 1 reply
|
The narrower version makes one recovery case more common: if the job fails after an approved call has reached the ad platform but before its result is checkpointed, recovery replays the decision verdict and can send the same bid change a second time. I'd carry the pending-approval id into that call as its idempotency key and record the outcome as succeeded, failed or unknown next to the verdict, so recovery can tell an effect that already happened from one that never went out. I keep the consumed-action check in the same transaction as the dispatch record here: https://gist.github.com/renezander030/ad81c7a805a09a844983f881e2c487e5 |
1 reply
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.
Follow-up discussion for #1067, as requested there.
Problem
A common agentic pattern is pausing a workflow for a human to approve a consequential step (send this email, execute this trade, merge this change) before continuing. Flink Agents already has the durable, checkpointed, keyed state that makes this pattern natural to support well, but the runtime questions raised on #1067 need answering before any implementation:
ActionTaskkeeps the key in flight, and later events for the same key are buffered. An approval delivered as an ordinary keyed input event could be queued behind the Action it needs to resume.A narrower first version: pluggable approver
Rather than treating every proposal as needing the full durable-suspend-resume path, treat the approver as pluggable, with a decision model as the first tier and a human as the fallback (credit to @dangzitou for this framing).
Use case. In cross-border e-commerce, for example, an agent proposes actions such as raising an ad bid or pausing a listing. Most proposals are routine and could be cleared automatically; only ambiguous or high-impact ones need a person. Sending every proposal to a human makes approval the bottleneck, and every one of them would take the hard suspend/resume path.
What already works today, with no new runtime semantics, now that DecisionModel resources have landed (#1243 / #1264):
DecisionRequestEventwith aPredicateQuestion(e.g. "Is this change within policy?") and application-supplied criteria.DecisionResponseEventhandler applies application-owned thresholds:probability_true >= T_approve-> continue to the next step (e.g. emit the event that triggers the tool call)probability_true <= T_reject-> reject and emit an outputRefusalAnswer, or a failed response -> escalate to a humanBecause the call goes through the built-in Decision Action, its outcome is recorded via durable execution when an Action State Store is configured, so recovery replays the verdict instead of asking the model again.
What this means for scope:
Open questions for maintainers
await_approval-style Action type the right shape, or should this stay a documented pattern built from existing primitives (Decision Action + a resource/tool call for the human-escalation leg)?Related: #1067, #1016, #1243, #1264
All reactions