Skip to content

Spec: decision step for workflows #246

Closed

Description

@Silthus

Question

What exactly does the first version of the decision step build, precisely enough that each implementation ticket can be built without another design decision?

Use /to-spec to write the spec from the resolved tickets above (execution path, context contract, use cases, prototype direction, Slack context), then /to-tickets to publish implement children of this map, wired with native blocking edges, each sized to one session and to one draft PR in a stack.

The spec covers: the step's schema, the builder node and config panel, the Node executor path, the Django route and its checks (flag, AI data processing approval, credits), failure and retry behavior, the mocked test walk, the run log, MCP tools.yaml and the graph-schema doc, the feature flag, and the acceptance examples from the use-case research.

Activity

  1. self-assigned this
    on Oct 4, 2026
  2. Silthus commented on Oct 4, 2026

    @Silthus
    OwnerAuthor

    Claimed by background spec worker (Claude Code, Opus 5.5). Wall-time cap 90 minutes.

  3. Silthus commented on Oct 4, 2026

    @Silthus
    OwnerAuthor

    Resolution

    Spec doc: #247 (Spec doc: AI decision step for workflows), labeled ready-for-agent and linked under #240.

    A native ai_decision action type, built on top of PostHog/posthog#107832. The CDP worker renders the author's Context and calls a workflows-owned Django route with a new scoped JWT. Django runs the gates and asks the hosted Jev model through ml_inference decide_when_available, with privacy_mode on and ai_product="workflows". The worker picks the output from the probabilities. On 429 or 503 it reschedules the person instead of retrying inline. The spec has a table that marks each piece of PostHog#107832 as kept, changed, or dropped.

    Implementation tickets, in order

    # Ticket Stacks on Blocked by Cast
    1 #248 Decide route and action type in Django, reviving PostHog#107832 (cherry-picks its six commits, credits Harley Alexander) upstream/master none GPT-6.1 Sol, else Opus 5.5
    2 #249 Node runtime that asks, branches and reschedules, plus graph-schema, tools.yaml and CONTRIBUTING #248 #248 GPT-6.1 Sol, else Opus 5.5
    3 #250 Builder palette, config panel and test surfaces #248 #248 Opus 5.5

    #249 and #250 are siblings, so the stack is two levels deep. #250 checks "Test with a person" live on a local stack with #249 merged in locally.

    Decisions on the open items

    • Test runs and credits. "Test with a person" makes a real call and uses one AI decision. Pressing it counts as consent, as with Run preview in spec Spec: Generate text — an LLM action node for workflows #22. A mock can't show real probabilities, and the author needs those to set a threshold. The Test panel stays mocked by default and spends nothing. A new mock_answer lets the author choose the path (A3).
    • Unsure band for yes or no. In v1. With Unsure on, the author sets "No at or below" (default 20%) under the yes threshold. The middle goes to the same Unsure output. It adds one number, it is the band the System One docs recommend, and A4 needs a review path.
    • Cost copy. "Each person who reaches this step uses one AI decision from your AI credits." No price and no volume estimate, because gateway billing is unverified. Probe P1 must confirm $ai_billable with a cost above 0 before the flag goes past internal organizations. If it fails, the credits clause comes out.
    • Removed handles (Decision step in the builder: shape and name #245's fourth item). Same rule as the conditional branch. Removing an option, switching the answer type, or turning Unsure off is blocked with "Clean up branching steps first" when it would orphan a step. Remaining edges keep their index.
    • Transport. How a workflow step reaches a hosted System One model #242's decide queue parameter is a Hog VM mechanism, and a native step runs no Hog. So the handler keeps the same contract without the VM. It makes one call per execution with a 10 s timeout. On 429 or 503 it returns scheduledAt. A 429 gives up after 30 minutes, a 503 after 5 reschedules.
    • Failure path. "If the decision fails" is the existing continue edge, so no new edge type is needed. on_error: abort lets a gate fail closed.
    • Also settled at spec time (reasons are in the spec): starting admission budgets, not a billable workflow action (AI credits carry the cost), not person-dependent, ties go to the earlier option, and the gateway's confidence field is not used.

    Notes

    • /to-spec and /to-tickets are blocked from model invocation in this runtime, so the spec follows the shape of spec Spec: Generate text — an LLM action node for workflows #22, and the tickets follow the fields in the dispatch brief.
    • Codex was not tried, because it had already returned 429 today. Code research ran on native subagents.
    • Rollout preconditions outside this repo are listed in the spec: the JWT secret in the charts and secrets repos, and probes P1 and P2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions