Admin Control Plane Strategy Cycles
Internal Admin Endpoints
Admin Control Plane Strategy Cycles
Internal-only admin contract that lets the Cloudflare control plane load active strategy-cycle scan candidates and execute one deterministic strategy-cycle tick through the existing shared workflow facade.
POST
Admin Control Plane Strategy Cycles
These routes are the second concrete workflow-orchestration migration seam from
Load active strategy-cycle scan candidates.
Request body:
Response:
Notes:
Execute one deterministic strategy-cycle scan through the shared strategy and
workflow runtime.
Request body:
Response:
Notes:
Resolve a terminal execution back to its owning strategy cycle and forward that
completion into the Cloudflare control plane.
Request body:
Response:
Notes:
Replay a stale or orphaned strategy-cycle wait through the Cloudflare-owned
runtime.
Request body:
Response:
Notes:
apps/engine into Cloudflare.
The ownership split is:
- Cloudflare
agent-control-planeowns scan cadence, queueing, and durable workflow instances platform-apiowns the thin authenticated admin surface- shared services still own the canonical strategy-cycle reconciliation and child workflow dispatch path
Scope
- Internal-only
- Protected by
ADMIN_AUTH_SECRET_TOKEN - Intended for
apps/agent-control-plane, not browser traffic
Endpoints
POST /v1/admin/control-plane/strategy-cycles/due
Load active strategy-cycle scan candidates.
Request body:
requestIdis the stable idempotency key Cloudflare should preserve when creating its own workflow instance- current due selection intentionally mirrors the engine scheduler’s active-strategy scan, not a narrower future matcher feed
POST /v1/admin/control-plane/strategy-cycles/tick
Execute one deterministic strategy-cycle scan through the shared strategy and
workflow runtime.
Request body:
userIdis resolved from the canonical linked wallet address when available- Cloudflare uses
userIdplusportfolioIdto mirror the tick result into durableUserAgent/PortfolioAgentstate - shared services still own the actual strategy-cycle reconciliation and
runNow(...)path during migration
Runtime Behavior
The current flow is:- Cloudflare calls
due - Cloudflare creates
StrategyCycleTickWorkflowinstances with the returned ids - Each Cloudflare workflow calls
tick platform-apidelegates to the shared strategy-cycle runtime- Cloudflare mirrors the resulting tick state into durable user/portfolio actors
POST /v1/admin/control-plane/strategy-cycles/notify-execution
Resolve a terminal execution back to its owning strategy cycle and forward that
completion into the Cloudflare control plane.
Request body:
platform-apiresolves the execution to a canonical child workflow viaworkflow_execution_refs- it then resolves the owning strategy via linked child workflow ids instead of guessing from request-id conventions
- Cloudflare prefers direct
sendEvent("execution_completed")into an already waitingStrategyCycleTickWorkflowsession and falls back to starting a fresh tick workflow when no active session is registered
POST /v1/admin/control-plane/strategy-cycles/recover
Replay a stale or orphaned strategy-cycle wait through the Cloudflare-owned
runtime.
Request body:
- this is an operator/admin replay surface, not a normal execution callback
- Cloudflare recovery is intentionally narrow and safe:
- replay an active
execution_completedwait on the same workflow instance when possible - start a fresh authoritative tick only when no active instance is registered
- fail closed when the active strategy-cycle workflow is not currently waiting on an event
- replay an active