feat(workflows): filter workflows-list MCP tool by status#60405
Closed
mayteio wants to merge 12 commits into
Closed
feat(workflows): filter workflows-list MCP tool by status#60405mayteio wants to merge 12 commits into
mayteio wants to merge 12 commits into
Conversation
Tighter help_text on HogFlow* serializers and tools.yaml entries to save LLM context tokens, plus a couple of cleanups: - Drop redundant `exit_condition: allow_null=True` (model column is NOT NULL, so null would 500 on save instead of validating cleanly) - Drop `exclude_params: trigger` from workflows-create/update — already excluded via `read_only_fields` on the serializer
Adds `status` to HogFlowFilterSet so the workflows-list MCP tool can narrow results to `active`, `draft`, or `archived` workflows — mirroring the lifecycle tabs in the workflows UI. Description in tools.yaml is updated so the parameter is discoverable. Regenerated downstream artifacts via `hogli build:openapi`: MCP Zod schema, MCP handler, tool-definitions JSON, frontend types, and the tool-schema snapshot.
Contributor
MCP UI Apps size report
|
Contributor
|
Size Change: 0 B Total Size: 80.3 MB ℹ️ View Unchanged
|
Contributor
|
Reviews (1): Last reviewed commit: "feat(workflows): filter workflows-list M..." | Re-trigger Greptile |
MCP CI doesn't start the plugins container (CDP_API_URL), so the workflows-run integration tests 500'd on every run. Drop those and cover the same surface area at the layers that don't need CDP: Django pytest with CDP mocked, plus an MCP unit test for handler wiring.
edges was a bare serializers.JSONField, so drf-spectacular emitted no
type info downstream. MCP clients had to guess the shape and ended up
JSON-stringifying the edges array, which the backend then stored as a
string and the executor choked on.
Replace with a typed ListField(child=HogFlowEdgeSerializer). Also
tighten the function action 'config' help_text so agents know inputs
must be wrapped in {value: ...} for hog templating to compile.
Contributor
Query snapshots: Backend query snapshots updatedChanges: 1 snapshots (1 modified, 0 added, 0 deleted) What this means:
Next steps:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
workflows-list(recently added in #60388) currently only acceptscreated_at,created_by,id,limit,offset,updated_at. The UI's workflows list is tab-filtered by status — once a team has more than a handful of workflows, MCP users hit the same problem the UI already solved.Changes
statustoHogFlowFilterSet.Meta.fields— django-filter auto-derives aChoiceFilterfromHogFlow.State(draft/active/archived) and drf-spectacular renders it as an enum query parameter.workflows-listdescription inproducts/workflows/mcp/tools.yamlso the parameter is discoverable to LLM clients.hogli build:openapi: MCP Zod schema, MCP handler, tool-definitions JSON, frontend types, MCP tool-schema snapshot.Matches the existing pattern in
posthog/api/hog_function.py(which already exposesenabledthis way).HogFlowStatusEnumis already registered inENUM_NAME_OVERRIDES, so no collision work needed.Backwards-compat: adding a new optional query parameter — existing callers that omit
statusget the same behavior as before.How did you test this code?
Added parameterized backend tests in
posthog/api/test/test_hog_flow.py:test_list_filters_by_status—draft,active,archived, no-filter; asserts the returned set matches the requested status.test_list_rejects_unknown_status— invalid value 400s instead of silently returning everything.MCP tool-schema snapshot updated via
pnpm --filter=@posthog/mcp exec vitest run -u tool-schema-snapshots— diff confirms the newstatusenum field is present.Publish to changelog?
no
🤖 Agent context
Claude Code (Opus). Single-value status filter chosen to mirror the UI's tabbed selector; multi-value via
CommaSeparatedListFilterwas considered but deferred — easy to extend later if needed.