Repository navigation
Description
Summary
The Keep Workflows UI editor silently reformats pasted YAML so that with: ends up as a sibling of provider: rather than nested inside it. The parser reads step.provider.with β so this breaks every action with errors like HttpProvider._notify() missing 2 required positional arguments: 'url' and 'method' or Message is required (Slack). No warning, no validation error β the workflow saves and fires, just with zero parameters.
Environment
- Keep build: commit
339151c9onmain(released 2026-04-14) - Affected UI: Workflows β + Create Workflow β Import YAML form
- Affected workflows: any workflow with actions/steps that use
with:
Reproduction
Paste this correctly-indented YAML into the Workflow editor:
workflow:
id: test-with-nesting
name: Test
triggers:
- type: alert
filters:
- key: source
value: prometheus
actions:
- name: test-slack
provider:
type: slack
config: " {{ providers.slack-prod }} "
with:
message: "test"Save. Query the stored workflow_raw directly:
docker exec keep-keep-backend-1 python3 -c "
import os, psycopg2
dsn = os.environ['DATABASE_CONNECTION_STRING'].replace('postgresql+psycopg2://', 'postgresql://')
conn = psycopg2.connect(dsn); cur = conn.cursor()
cur.execute(\"SELECT workflow_raw FROM workflow WHERE name = 'Test'\")
print(cur.fetchone()[0])"Observed output (note indentation change):
id: test-with-nesting
name: Test
triggers:
- type: alert
filters:
- key: source
value: prometheus
actions:
- name: test-slack
provider:
type: slack
config: " {{ providers.slack-prod }} "
with: # β MOVED OUT of provider!
message: "test"Fire the workflow
Trigger an alert matching the filter. Logs on keep-keep-backend-1:
"Notifying message to Slack using webhook", "slack_message": "", "blocks": [], "channel": ""
"Failed to run step test-slack with error Message is required - see for example https://github.com/keephq/keep/blob/main/examples/workflows/slack_basic.yml#L16"
slack_message is empty because the parser never found with.message β provider_parameters = _step.get("provider", {}).get("with") (parser.py _parse_steps) returns None.
Root cause
Speculating based on symptoms:
- The UI's YAML-parse-then-reserialize round-trip (e.g., via a js-yaml or similar) is applying different indentation rules than the parser expects
- OR the YAML β object β YAML roundtrip normalizes
with:to the same level asprovider:in some transform pipeline
Haven't traced the exact code path in keep-ui/ but happy to dig if someone points at the editor component.
Impact
Every workflow authored via the UI editor with a with: block silently breaks on the FIRST run. No error at save-time, no validation, no linter warning β failure only surfaces at execution time as "missing positional arguments" or "Message is required". Operators waste hours debugging working-looking YAML.
Workaround
Edit the workflow_raw column directly in the DB:
import os, psycopg2
conn = psycopg2.connect(os.environ['DATABASE_CONNECTION_STRING'].replace('postgresql+psycopg2://', 'postgresql://'))
cur = conn.cursor()
NEW_YAML = """<correctly-indented YAML>"""
cur.execute("UPDATE workflow SET workflow_raw = %s WHERE name = %s", (NEW_YAML, 'Test'))
conn.commit()Suggested fix
-
Validation at save-time: before persisting, run
Parser._parse_steps/_parse_actionsagainst the YAML and reject ifstep.provider.withis unreachable whenstep.withis present at action level β this catches the structural issue before it's committed. -
Preserve source indentation: if the UI editor is auto-reformatting, switch to a text-mode editor that doesn't touch indentation (or disable the reformat).
-
Document schema explicitly in
examples/workflows/comments: "with:MUST be nested insideprovider:. Siblings at action level are NOT read." -
Migrate stored workflows: a one-time migration that moves
step.withβstep.provider.withfor existing affected workflows.
Happy to contribute any of these if there's interest.
Related
Discovered same day as separate bug: HTTP/bash/python/console providers hidden from Connect Provider UI catalog β both stem from the UI layer + provider system interaction being more fragile than the backend.
Activity
dosubot commentedon Apr 21, 2026
Great investigation @ckaiser-graniterock β I can confirm your analysis and add some specifics from the codebase.
Your diagnosis is correct. Both the backend parser and the frontend UI only look for
with:nested underprovider::_parse_steps, parameters are extracted via_step.get("provider", {}).get("with")[1]_parse_actions, viaprovider.get("with", {})[2]getV2StepOrV2ActionreadsactionOrStep.provider?.with[3]So
with:as a sibling toprovider:is silently ignored everywhere β no parser path checks for it.The root cause of the "move" is the import flow bypassing validation. Strict Zod schemas exist that would catch this β
YamlStepOrActionSchemauses.strict()which rejects unknown keys at the step level [4]. However, the actual file import path callsparseWorkflowYamlStringToJSON[5] [6], which is just a bareyaml.parse()with no schema validation. There's a separateparseWorkflowYamlToJSONfunction [7] that does apply validation, but the import flow doesn't use it.So what happens on round-trip:
with:at step level is acceptedgetV2StepOrV2Actionreadsprovider?.withβ getsundefined(content silently lost)getYamlStepFromStepreconstructsprovider: { ..., with: withParams }β generates an emptywith:underprovider:[8]This is part of a broader pattern β other users have reported similar silent data loss: workflow inputs disappearing on save [9], YAML editor changes being lost [10], quoted strings losing quotes [11], and the UI builder silently dropping unsupported configurations [12].
The most targeted fix would be updating the import path in
BuilderWorkflowYAMLImport[13] to useparseWorkflowYamlToJSON(with schema validation) instead ofparseWorkflowYamlStringToJSON, so users get an immediate error whenwith:is misplaced rather than a silent save + runtime failure. Your other suggestions (backend validation, migration, docs) are all solid complementary fixes.Also worth noting: there's an inconsistency between
_parse_steps(returnsNoneifwithis missing) and_parse_actions(returns{}if missing) [1] [2], which could cause subtle differences in error behavior depending on whether the workflow uses steps vs. actions.To reply, just mention @dosu.
Docs are dead. Just use Dosu.
DPS0340 commentedon Jul 25, 2026
Opened #6647 for the import-path half of this.
I verified the diagnosis in this thread against the code rather than assuming it. Parsing the reported YAML confirms the parameters end up unreachable:
The import handler was calling
parseWorkflowYamlStringToJSON(a bareyaml.parse(), with its own// todo: use zod schemacomment), so nothing checked the shape. #6647 switches it toparseWorkflowYamlToJSON, which applies the.strict()workflow schema β the misplacement is now reported at import time via the existing error toast instead of saving a workflow that fires with no parameters.Scope note: I kept it to the import path. The backend-side validation and a migration for already-saved workflows are both worth doing, but they're separate changes with wider blast radius β happy to follow up on either if you'd like them.