Workflow Engine (v0.4 foundation)
Workflow Engine (v0.4 foundation) Purpose Resumable multi-step automation per docs 02-system-architecture-prompt.md §7. Current Scope Domain contracts: WorkflowStepInterface, WorkflowRunnerInterface, WorkflowRunStoreInterface Application: WorkflowRunner, WorkflowRegistry, StartWorkflow, GetWorkflowRun Infrastructure: WorkflowRunRepository, AsyncQueueDriver (Action Scheduler → WP-Cron fallback)…
Workflow Engine (v0.4 foundation)#
Purpose#
Resumable multi-step automation per docs 02-system-architecture-prompt.md §7.
Current Scope#
- Domain contracts:
WorkflowStepInterface,WorkflowRunnerInterface,WorkflowRunStoreInterface - Application:
WorkflowRunner,WorkflowRegistry,StartWorkflow,GetWorkflowRun - Infrastructure:
WorkflowRunRepository,AsyncQueueDriver(Action Scheduler → WP-Cron fallback) - Built-in workflow:
publish_product(8 steps) - REST:
POST /workflows,GET /workflows/{run_id},POST /workflows/{run_id}/resume
Feature Flag#
- Setting:
enable_workflows(defaultfalse)
Publish Product Steps#
validate_productgenerate_descriptiongenerate_seoapply_contentensure_featured_image— skips if image present; else saves brief + hooksteddy_workflow_generate_product_image/teddy_workflow_need_product_image(require_imageinput optional). Default handler tries WP AI Client image generation, then GD placeholder PNG.generate_translation_draft— only when inputtarget_languageis set; stores_teddy_i18n_draft_{lang}publish_productnotify_complete— optionalnotify_emailviawp_mail
State is persisted after each step in wp_teddy_workflow_runs.
Verification#
tests/Unit/ChatMemoryComposerTest.php(WorkflowRunnerTest)