Feature(UI): Canvas Workflow Integration - Run Workflow on Raster Layer#8665
Conversation
This commit implements a new feature that allows users to run workflows directly from the unified canvas. Users can now: - Access a "Run Workflow" option from the canvas layer context menu - Select a workflow with image parameters from a modal dialog - Customize workflow parameters (non-image fields) - Execute the workflow with the current canvas layer as input - Have the result automatically added back to the canvas Key changes: - Added canvasWorkflowIntegrationSlice for state management - Created CanvasWorkflowIntegrationModal and related UI components - Added context menu item to raster layers - Integrated workflow execution with canvas image extraction - Added modal to global modal isolator This integration enhances the canvas by allowing users to leverage custom workflows for advanced image processing directly within the canvas workspace. Implements feature request for deeper workflow-canvas integration.
…-011CV36r1eKmax4DQhPyfiHf
- Extract WorkflowFieldRenderer component for individual field rendering - Add WorkflowFormPreview component to handle workflow parameter display - Remove workflow compatibility filtering - allow all workflows - Simplify workflow selector to use flattened workflow list - Add comprehensive field type support (String, Integer, Float, Boolean, Enum, Scheduler, Board, Model, Image, Color) - Implement image field selection UI with radio
- Add useFilteredWorkflows hook to filter workflows with ImageField inputs - Add workflowHasImageField utility to check for ImageField in Form Builder - Only show workflows that have Form Builder with at least one ImageField - Add loading state while filtering workflows - Improve error messages to clarify Form Builder requirement - Update modal description to mention Form Builder and parameter adjustment - Add fallback error message for workflows without Form Builder
…on state - Add _version field (v1) to canvasWorkflowIntegrationState for future migrations - Add persistConfig with migration function to handle version upgrades - Add persistDenylist to exclude transient state (isOpen, isProcessing, sourceEntityIdentifier) - Use es-toolkit isPlainObject and tsafe assert for type-safe migration - Persist selectedWorkflowId and fieldValues across sessions
|
This feature looks like an awesome addition to Invoke! Just from watching the video my only feedback would be to do away with that image checkbox and upload section, I think we can safely assume they're running that workflow on the image layer and don't need that extra semi-confusing step. Unless I'm missing something ofc. |
|
Some workflows can have more then one Image input so you need that selection Option. Maybe not if there is only one but this can be done later. |
…w-integration-011CV36r1eKmax4DQhPyfiHf
there is now a output canvas node. |
…nvasWorkflowIntegration/useCanvasWorkflowIntegrationExecute.tsx Co-authored-by: dunkeroni <[email protected]>
dunkeroni
left a comment
There was a problem hiding this comment.
Interactions between canvas and workflows are going to need further PRs, but this is a sold framework that we can build on for that.
…low-integration-011CV36r1eKmax4DQhPyfiHf


Summary
This PR adds a Canvas Workflow Integration feature that allows users to execute workflows directly on canvas layers, with a dedicated
canvas_outputbackend node and an entry-based staging area that supports multiple output images.Canvas Workflow Integration
Adds a new modal dialog accessible from raster layer context menus that enables users to:
Canvas OutputnodeCanvas Output Node
Adds a new
CanvasOutputInvocationbackend node (canvas_output) that explicitly marks which images should be routed to the canvas staging area. This replaces a fragile heuristic that detected output nodes by scanning forboardinput fields.Breaking change: Workflows need a
Canvas Outputnode to work with canvas workflow integration.Entry-Based Staging Area
Rearchitects the staging area so each
canvas_outputnode in a workflow produces its own navigable entry. A workflow with 2Canvas Outputnodes will show 2 separate thumbnails in the staging area strip, each individually selectable and acceptable.Bug Fixes
'auto'/'none'strings which the backend rejects — these are now filtered during graph construction.QA Instructions
Canvas OutputnodeCanvas Outputnodes → verify 2 separate entries appear in staging area strip, each with its own thumbnail, individually navigable with arrow keyssave_imagenode alongsidecanvas_output→ verify it queues without "BoardField" validation errorcanvas_outputnode do NOT appear in the canvas workflow selectorVideo Demo
Demo
Merge Plan
No special merge considerations. Standard merge to main is fine.
Checklist
What's Newcopy (if doing a release after this PR)