Skip to content

feat(workflows): add Generate text step (combines #55-#58) - #60

Closed
Silthus wants to merge 5 commits into
masterfrom
feat/workflows-llm-action
Closed

Silthus wants to merge 5 commits into
masterfrom
feat/workflows-llm-action

Conversation

@Silthus

@Silthus Silthus commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Problem

A workflow author cannot make a workflow write text that adapts to the person a run is for. Personalizing beyond variable substitution means calling an LLM from their own backend and writing the result back, which most teams never do.

The fix exists as a 4-layer stack (#55, #56, #57, #58), but a stack cannot be opened upstream from a fork. This PR combines the stack into one branch so the feature can be reviewed and shipped whole.

Implements the Generate text spec.

Changes

  • Adds a Generate text node in a new AI category of the workflow builder, behind the workflows-llm-action flag: the author writes a liquid prompt, declares output fields that map to workflow variables, and picks one of six models.
  • A two-pass Celery task generates: the author's model writes the text, a pinned extraction model fills the declared fields under a strict JSON schema. Both passes bill as PostHog AI credits.
  • The CDP parks the workflow job while the generation runs and wakes it on a finished event, with backup polls at 1, 3 and 5 minutes. A parked run holds no worker and consumes no async step.
  • The builder panel derives the field-to-variable mapping and previews the real generation on real credits.
  • Docs, the building-workflows skill, and the MCP tool description ship in the same change.

Shape: one commit per stack layer, protocol first. Review commit-by-commit; each commit's stack PR carries the full layer description and review history.

Commit Layer Stack PR
1 Django endpoint + two-pass Celery task #55
2 CDP park-and-wake transport #56
3 Builder panel + Run preview #57
4 Docs, skill, MCP #58

Review guide: the artifact's Review guide tab has the reading order, the contract to load first, a ten-item risk ledger, and a sitting plan for this PR.

Note

Three decisions ask for explicit sign-off (guide §6): the tach.toml edge to ai_observability, byte-identical duplicate steps sharing one generation, and DRF-native auth where six precedent endpoints hand-roll the header.

No screenshot: the panel is unreachable until the flag is on and a seeded template-workflow-llm exists; no Storybook story covers the editor panel. First live render is a rollout step on an internal org.

How did you test this code?

Automatic notifications

  • Publish to changelog?

Docs update

Commit 4 is the docs update (skill, references, MCP tool description, CONTRIBUTING).

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

I (actually Claude Fable 5, session) squashed the four stack layers into one commit each on top of master and verified the resulting tree matches the stack top exactly. No source changed in this session; the layers' own agent context lives on #55-#58. Skills invoked here: /writing-pr-descriptions. Pre-commit formatting was bypassed for three of the four squash commits because this worktree has no nodejs node_modules; the content is identical to the CI-green stack branches.

Silthus and others added 5 commits August 6, 2026 05:56
Records where issues live, the triage label vocabulary, and the domain
doc layout, so the engineering skills read config instead of guessing.

Issues point at this fork rather than upstream PostHog/posthog. Every
gh command carries an explicit --repo, because a bare gh call starts
resolving to upstream as soon as an upstream remote is added.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017H2QuJYDAMJMQtA7R3ZNnH
…#55)

Squash of stack layer 1. Full description and review history on PR #55.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NTvmNPocVEY7UT73UnJHCg
)

Squash of stack layer 2. Full description and review history on PR #56.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NTvmNPocVEY7UT73UnJHCg
…57)

Squash of stack layer 3. Full description and review history on PR #57.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NTvmNPocVEY7UT73UnJHCg
…ributors (#58)

Squash of stack layer 4. Full description and review history on PR #58.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NTvmNPocVEY7UT73UnJHCg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant