Skip to content

improvement(workflow-block): support manual workflow ID via advanced mode#4573

Merged
waleedlatif1 merged 4 commits into
stagingfrom
waleedlatif1/workflow-selector-manual
May 12, 2026
Merged

improvement(workflow-block): support manual workflow ID via advanced mode#4573
waleedlatif1 merged 4 commits into
stagingfrom
waleedlatif1/workflow-selector-manual

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

Summary

  • Adds advanced-mode manualWorkflowId short-input to the Workflow and Workflow Input blocks, mirroring the basic/advanced toggle pattern used by Slack (channel/manualChannel) and Google Sheets (spreadsheetId/manualSpreadsheetId)
  • Both inputs share canonicalParamId: 'workflowId', so the serializer collapses whichever mode is active to params.workflowId for workflow_executor — no executor changes needed
  • Lets users paste/type a workflow ID directly when the visual selector isn't enough (e.g. cross-workspace IDs, deleted-workflow recovery)

Type of Change

  • Improvement

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link
Copy Markdown

vercel Bot commented May 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped May 12, 2026 11:20pm

Request Review

@cursor
Copy link
Copy Markdown

cursor Bot commented May 12, 2026

PR Summary

Medium Risk
Moderate risk because it changes workflow block parameter modeling (basic/advanced canonicalization) and dependency resolution for input-mapping, which could affect which child workflow is fetched and how inputs are mapped; remaining changes are cosmetic styling tweaks and a lockfile update.

Overview
Adds an advanced-mode manualWorkflowId field to the Workflow and Workflow Input blocks, with both selector/manual inputs sharing canonicalParamId: 'workflowId' so downstream params resolve to a single workflowId.

Updates InputMapping to accept the full subBlock config and to resolve its dependent workflowId via useDependsOnGate (instead of reading a hardcoded sibling value), ensuring input mapping works regardless of whether the workflow was chosen via selector or manual ID.

Also makes small blockquote Tailwind selector ordering tweaks across markdown renderers and bumps bun.lock with a configVersion entry.

Reviewed by Cursor Bugbot for commit 0a8dd68. Configure here.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 12, 2026

Greptile Summary

This PR adds an "advanced mode" manual workflow ID text input (manualWorkflowId) to both the Workflow and Workflow Input blocks, mirroring the existing canonical basic/advanced swap pattern (e.g., Slack channel/manualChannel). Both inputs share canonicalParamId: 'workflowId', so the serializer transparently collapses the active mode's value to params.workflowId without executor changes.

  • workflow.ts / workflow_input.ts: Adds manualWorkflowId (short-input, mode: 'advanced') and annotates the existing workflowId selector with mode: 'basic'/canonicalParamId, enabling the canonical swap toggle.
  • input-mapping.tsx: Switches from direct useSubBlockValue(blockId, 'workflowId') to useDependsOnGate(blockId, subBlock, ...) and reads dependencyValues.workflowId, so the child workflow schema loads correctly when a manual ID is active in advanced mode.
  • 4 component files: Non-functional Tailwind class reordering on blockquote elements (same visual output).

Confidence Score: 5/5

Safe to merge — the canonical basic/advanced swap is implemented correctly and the input-mapping fix ensures child workflow schemas load in both modes.

The block definitions correctly follow the established canonical pair pattern, and input-mapping.tsx now reads the workflow ID through useDependsOnGate, which resolves canonically across basic and advanced mode. The resolvePreviewContextValue removal is a clean equivalence: normalizeDependencyValue handles both raw values and { value: T } wrappers the same way. The remaining file changes are cosmetic Tailwind reorderings with no behavioral impact.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/blocks/blocks/workflow.ts Adds manualWorkflowId (short-input, mode: 'advanced') and annotates existing workflowId selector with canonicalParamId/mode: 'basic', correctly implementing the basic/advanced canonical swap pattern.
apps/sim/blocks/blocks/workflow_input.ts Same canonical pair additions as workflow.ts; inputMapping.dependsOn: ['workflowId'] correctly uses the canonical ID so the gate resolves against whichever mode is active.
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/input-mapping/input-mapping.tsx Prop changed from subBlockId: string to subBlock: SubBlockConfig; workflow ID resolved via useDependsOnGate to correctly pick the canonical value in both basic and advanced modes.
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/sub-block.tsx Call site updated from subBlockId={config.id} to subBlock={config} to match the new InputMapping prop interface — correct and minimal.
apps/sim/app/chat/components/message/components/markdown-renderer.tsx Non-functional Tailwind class reordering on blockquote element; no behavioral change.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User opens Workflow / WorkflowInput block] --> B{Advanced mode toggle}
    B -- basic --> C[workflowId\nworkflow-selector]
    B -- advanced --> D[manualWorkflowId\nshort-input]
    C -- "canonicalParamId: 'workflowId'" --> E[Canonical resolver\nresolveDependencyValue]
    D -- "canonicalParamId: 'workflowId'" --> E
    E --> F[params.workflowId\nfor workflow_executor]
    E --> G[useDependsOnGate in InputMapping\ndependencyValues.workflowId]
    G -- non-empty --> H[useWorkflowState\nfetch child schema]
    G -- empty --> I[No workflow selected\nplaceholder]
    H --> J[Render InputMapping fields]
Loading

Reviews (3): Last reviewed commit: "refactor(input-mapping): resolve workflo..." | Re-trigger Greptile

Comment thread apps/sim/blocks/blocks/workflow_input.ts
Comment thread apps/sim/blocks/blocks/workflow_input.ts
@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 0a8dd68. Configure here.

@waleedlatif1 waleedlatif1 merged commit ec936be into staging May 12, 2026
14 checks passed
@waleedlatif1 waleedlatif1 deleted the waleedlatif1/workflow-selector-manual branch May 12, 2026 23:39
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