Internal-only admin contract that lets the Cloudflare control plane load due workflow monitors and execute monitor ticks through the existing shared workflow facade.
apps/engine
workflow-monitor orchestration into Cloudflare Workflows.
The ownership split is:
agent-control-plane owns due scanning cadence and durable workflow instancesplatform-api owns the thin authenticated admin surfaceWorkflowsFacade.tickMonitor(...) remains the deterministic shared mutation pathADMIN_AUTH_SECRET_TOKENapps/agent-control-plane, not browser trafficPOST /v1/admin/control-plane/workflow-monitors/duerequestId is the stable idempotency key Cloudflare should preserve when creating its own workflow instanceworkerId is the stable worker identity passed through to tickMonitor(...)POST /v1/admin/control-plane/workflow-monitors/tickWorkflowsFacade.tickMonitor(...).
Request body:
triggerEvent is optional. The current accepted kinds are:
market_pricemarket_candlesapproval_pending_countaccount_buying_power_usdaccount_cash_usdportfolio_nav_usdportfolio_cash_pctportfolio_drift_from_targetportfolio_concentrationportfolio_held_asset_performanceportfolio_held_asset_metricsuserId is resolved from the canonical linked wallet address when availableuserId plus linkedPortfolioIds[0] to mirror the monitor tick into UserAgent / PortfolioAgentPOST /v1/admin/control-plane/workflow-monitors/notify-executionenqueue-tick seam.
Request body:
due plus tickworkflow_execution_refs
using operationId, runId, executionRequestId, and eventIdportfolioId so the Cloudflare worker
can look up an already waiting monitor session on PortfolioAgent202 with enqueued: false instead
of treating the callback as an errorPOST /api/workflow-monitors/enqueue-tick on the
Cloudflare worker instead of mutating workflow state locallyPOST /v1/admin/control-plane/workflow-monitors/notify-trigger-matchdue.
Request body:
platform-api still validates the workflow and owner via
WorkflowsFacade.get(...)triggerEvent payload now supports authoritative fact packets
for market_price, market_candles, approval_pending_count,
account_buying_power_usd, account_cash_usd, portfolio_nav_usd,
portfolio_cash_pct, portfolio_drift_from_target,
portfolio_concentration, portfolio_held_asset_performance, and
portfolio_held_asset_metricsportfolioId so Cloudflare can mirror the
resulting monitor workflow state into PortfolioAgent / UserAgentPOST /api/workflow-monitors/enqueue-tick
seam using reason: "trigger_match"POST /v1/admin/control-plane/workflow-monitors/recoverexecution_completed or trigger_matched wait on the
same workflow instance when possibletriggerEvent fact packets can be supplied when recovery should
replay a matcher-driven wake with authoritative dependency datadueWorkflowMonitorTickWorkflow instances with the returned idstickplatform-api delegates to WorkflowsFacade.tickMonitor(...)notify-executionplatform-api resolves the owning workflow from canonical execution refsplatform-api forwards into Cloudflare enqueue-tick with the linked
portfolioIdWorkflowMonitorTickWorkflow session via sendEvent("execution_completed")create -> tick pathticknotify-trigger-matchplatform-api validates the workflow and ownerplatform-api forwards into Cloudflare enqueue-tick with
reason: "trigger_match"WorkflowMonitorTickWorkflow without waiting
for a global due scantick