Skip to content

[πŸ› Bug]: Workflow UI editor silently moves with: out of provider:, breaking every actionΒ #6274

Open

Description

@ckaiser-graniterock

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 339151c9 on main (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 as provider: 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

  1. Validation at save-time: before persisting, run Parser._parse_steps / _parse_actions against the YAML and reject if step.provider.with is unreachable when step.with is present at action level β€” this catches the structural issue before it's committed.

  2. 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).

  3. Document schema explicitly in examples/workflows/ comments: "with: MUST be nested inside provider:. Siblings at action level are NOT read."

  4. Migrate stored workflows: a one-time migration that moves step.with β†’ step.provider.with for 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

  1. added
    Bug
    UI
    on Apr 21, 2026
  2. dosubot commented on Apr 21, 2026

    @dosubot

    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 under provider::

    • In _parse_steps, parameters are extracted via _step.get("provider", {}).get("with") [1]
    • In _parse_actions, via provider.get("with", {}) [2]
    • In the frontend, getV2StepOrV2Action reads actionOrStep.provider?.with [3]

    So with: as a sibling to provider: 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 β€” YamlStepOrActionSchema uses .strict() which rejects unknown keys at the step level [4]. However, the actual file import path calls parseWorkflowYamlStringToJSON [5] [6], which is just a bare yaml.parse() with no schema validation. There's a separate parseWorkflowYamlToJSON function [7] that does apply validation, but the import flow doesn't use it.

    So what happens on round-trip:

    1. YAML is parsed without validation β†’ with: at step level is accepted
    2. getV2StepOrV2Action reads provider?.with β†’ gets undefined (content silently lost)
    3. On save, getYamlStepFromStep reconstructs provider: { ..., with: withParams } β†’ generates an empty with: under provider: [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 use parseWorkflowYamlToJSON (with schema validation) instead of parseWorkflowYamlStringToJSON, so users get an immediate error when with: 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 (returns None if with is 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.

    Leave Feedback Ask Dosu about keep Share Dosu with your team

  3. DPS0340 commented on Jul 25, 2026

    @DPS0340

    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:

    provider.with   β†’ undefined              ← what keep/parser/parser.py and the UI both read
    step-level with β†’ { message: "test" }    ← where the parameters actually sit
    

    The import handler was calling parseWorkflowYamlStringToJSON (a bare yaml.parse(), with its own // todo: use zod schema comment), so nothing checked the shape. #6647 switches it to parseWorkflowYamlToJSON, 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugUI

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions