Skip to content

About

Production-minded AI automation platform for orchestrated workflows, validation, approvals, persistence, and observability.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

82 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FlowPilot — AI Workflow Automation

An AI workflow automation workspace for launching, tracking, and reviewing bounded AI-assisted workflows.

FlowPilot combines a shared React client workspace with a FastAPI workflow control plane. The client-facing UI lives inside the authenticated AI Engineering Studio workspace; the former standalone Streamlit UI is retired and its legacy URL shows a workspace handoff notice. The system is designed around explicit workflow definitions, asynchronous execution, role-scoped access, observable run state, and human approval boundaries for external-impact actions.

What FlowPilot does

The current workspace exposes four workflow types:

Workflow Purpose Typical output
Content Agent Turn a topic or brief into channel-aware content drafts Multi-channel draft for human review
Competitor Intelligence Process configured RSS/Atom sources and synthesize observed signals Evidence-oriented intelligence brief
Outreach Agent Qualify an opportunity and prepare contextual outreach Approval-ready draft; sending is not automatic
KPI & Progress Tracker Normalize updates and surface blockers Leadership progress briefing

Application workflow

  1. The operator selects a workflow and provides its bounded input.
  2. The UI submits an authenticated request to the FastAPI service.
  3. The API creates a run reference and schedules execution.
  4. Workflow execution records progress and a terminal result.
  5. The workspace polls the run and its owner-scoped event timeline, then presents the recorded stages, durations, output, and review context in a live run canvas.
  6. Actions with external impact remain subject to approval and role permissions.

Architecture

  • Frontend: shared React workspace served by the Studio Worker at /workspace/apps/flowpilot.
  • Legacy UI: ui/app.py is a minimal migration notice only; it is not a workflow client and makes no product API calls.
  • API: FastAPI control plane (app/api/main.py).
  • Execution: the no-new-service Free Render topology enqueues RQ jobs to the existing Upstash Redis database. A supervised SimpleWorker child process runs workflows separately from the API request loop.
  • State: owner-scoped run records, dispatch metadata, approval state, and short-lived encrypted Gateway job credentials are stored in the same Redis database under a dedicated key prefix. PostgreSQL remains an optional backend.
  • LLM access: portfolio BYOK uses a short-lived, project-scoped Gateway session; raw provider credentials are not put in RQ job arguments.
  • Observability: health, run metrics, structured logs, and optional OpenTelemetry instrumentation. The shared workspace reads GET /api/v1/runs/{run_id}/events; real LangGraph execute and validate node boundaries emit bounded stage-start, completion, duration, and failure metadata into the existing audit store. PostgreSQL, Redis, and in-memory test backends share one repository contract. Event reads are owner-scoped and expose an allowlist of client-safe event types; provider credentials, prompts, and raw agent outputs are not copied into the timeline.

BYOK and Gateway handoff

When a client launches FlowPilot from the Studio workspace, Studio owns provider selection and the user-supplied provider credential. The browser receives a single-use, project-scoped handoff code and opens the same-origin React workspace route. Studio exchanges the code server-side and keeps the resulting project credential in a path-scoped HttpOnly cookie; the browser never handles a reusable bearer token. The Studio API proxy validates the project route and forwards only allowed operations to the FlowPilot API.

Do not put provider API keys or reusable Gateway bearer tokens in source control, URL parameters, or browser storage.

Deployment

The root render.yaml defines the current no-new-service Free-tier topology:

  • ai-automation-api — FastAPI, Redis-backed run state, RQ enqueueing, and a supervised embedded worker child process in the same existing Free web service.

The standalone ai-automation-ui service is no longer part of the manifest. Its entrypoint has been replaced with a retirement notice that sends any existing bookmark to the authenticated Studio workspace. After that notice is deployed and verified, suspend the old Render UI service; do not suspend or remove ai-automation-api.

This topology does not create a Render Background Worker, Render Key Value, Render Postgres, or a second Upstash database. It reuses the existing Free Upstash Redis database. The API parent remains available to serve HTTP while the isolated child process consumes workflow jobs.

Free-tier RQ worker configuration

Configure these variables on ai-automation-api:

  • REDIS_URL — native TLS Redis connection URL, rediss://default:<password>@<host>:6379/0. Use the Upstash TCP endpoint and password, not the Upstash REST URL/token.
  • REDIS_STATE_ENABLED=true — stores run history and control state in Redis when DATABASE_URL is blank.
  • REDIS_KEY_PREFIX=aiac-flowpilot — isolates FlowPilot state keys from other applications sharing the Redis database.
  • QUEUE_NAME=aiac-flowpilot — isolates the RQ queue name.
  • EMBEDDED_RQ_WORKER_ENABLED=true — supervises one RQ worker child process inside the existing API service.
  • QSTASH_WORKFLOW_ENABLED=false and INLINE_EXECUTION=false — select RQ instead of the older QStash or in-process execution paths.
  • WORKFLOW_JOB_TIMEOUT_SECONDS=600 — bounds each workflow job.
  • FLOWPILOT_GATEWAY_CREDENTIAL_KEY — Fernet key used to encrypt short-lived Gateway session tokens stored in Redis with a TTL.

DATABASE_URL is optional. Leave it unset for this zero-new-database setup; when configured, PostgreSQL remains the preferred run-state backend while Redis is still used for the RQ queue.

The embedded worker is deliberately limited to one concurrent workflow on the Free API instance. It uses RQ's SimpleWorker in a supervised child process: long model calls do not occupy the FastAPI request loop, and Stop can terminate the isolated worker process without killing the API. The supervisor starts a replacement worker after a stop or unexpected worker exit. Run state and queued jobs remain in Upstash Redis across Render process restarts.

Run controls: Pause prevents a queued job from starting. For a running job, the model call is allowed to reach its next completion boundary and its result is held in Redis until Resume; Resume commits that result without repeating the inference. Stop marks the run cancelled, cancels queued work or terminates the isolated worker process, and prevents any late result from replacing the cancelled state. An external provider request already accepted by the provider may still finish remotely.

Free-tier limits: this shares the API service's CPU and memory, so it is suitable for the portfolio/demo workload rather than heavy parallel load. Render's free service may sleep when idle; queued work is consumed when the service is awake. The existing Upstash Free database is shared with the Portfolio LLM Gateway, so its 500K monthly-command, 256 MB data, and 10 GB monthly-bandwidth limits apply to both applications together. Keep the separate aiac-flowpilot key prefix and monitor combined usage.

Alternative queue deployments

render.durable-worker.yaml and render.production.yaml describe optional paid topologies with separate worker/Redis/PostgreSQL resources. Do not apply those manifests for the current no-cost deployment. The current path does not provision or upgrade any paid service.

The previous QStash HTTP-message integration remains in the code as a compatibility path, but it is disabled in the current deployment configuration. The old QStash credentials can remain in Render without being used.

Local development

Copy the example environment file, set local-only credentials, and start the Compose stack:

cp .env.example .env
docker compose up --build

The Compose stack still includes API and supporting development services. The former Streamlit workflow UI is no longer a local product interface; ui/app.py now renders the retirement notice. Use the shared React workspace hosted by Studio for the client-facing FlowPilot experience.

Validation

Run the repository checks from its root:

ruff check app ui tests scripts
python -m compileall -q app ui tests scripts
pytest -q

For a Docker test run, build the test target first, then run the resulting image:

docker build --no-cache --target test -t flowpilot-test .
docker run --rm flowpilot-test

A passing CI run establishes the checks included in that workflow; it does not by itself verify live provider credentials, Render environment configuration, external integrations, or hosted end-to-end behavior.

Safety and operating boundaries

  • Content and outreach workflows prepare drafts; external publishing or sending is not automatic.
  • API permissions are role-scoped.
  • Gateway tokens are short-lived and project-scoped.
  • Workflow execution and approval state are kept distinct.
  • A demo deployment should use synthetic/sample inputs, not confidential client material.

Portfolio positioning

FlowPilot — AI Workflow Automation: a distinct AI application for orchestrating bounded workflows, tracking execution, and keeping consequential actions reviewable. It is not the shared Evaluation Harness dashboard and is not the private Agency OS.

Hosted deployment verification

The canonical product API is:

  • API: https://ai-automation-api.onrender.com

The former UI address https://ai-automation-ui-ac2c.onrender.com is retained only as a temporary migration notice until the Render service is suspended. It is not a supported product entry point.

The no-new-service RQ/Redis topology was deployed on November 26, 2026 from merge commit a47cbe9 to the existing Free API service. Live checks returned:

  • GET / — state_store=redis and free API service -> RQ/Upstash Redis queue -> supervised embedded worker process -> Redis run state.
  • GET /health — execution_mode=embedded_rq_worker.
  • GET /ready — status=ready, state_store=redis, redis=embedded_rq_worker.

The verified hosted topology uses the existing Free ai-automation-api service. The RQ worker runs as a supervised child inside the API service and uses the existing Free Upstash Redis database shared with the Portfolio LLM Gateway; no new Render worker, Redis database, or PostgreSQL database was created. The former standalone UI service should be suspended after its migration notice deployment is confirmed.

Local validation: 198 tests passed, including a real RQ SimpleWorker integration test against fakeredis with Redis-backed run-state persistence. No live LLM/provider request was sent during deployment verification. A full live BYOK workflow execution is intentionally not claimed as tested.

Runtime evaluation reporting

When the evaluation harness URL and project-scoped ingest token are configured, FlowPilot reports a second evaluation.completed event after each workflow result is finalized. The score event is kept separate from the existing run.completed / run.failed activity event and contains only bounded numeric signals:

  • runtime.workflow_completion — whether the workflow reached a successful terminal state or its explicit approval checkpoint.
  • runtime.step_coverage — observed completed LangGraph stages divided by the required execute and validate stages.
  • runtime.validation_completed — whether the actual validation node completed.
  • runtime.approval_compliance and runtime.approval_pending — approval checkpoint state for content/outreach actions.
  • runtime.audit_traceability — whether the result has its workflow-engine audit evidence record.
  • runtime.warning_count — bounded warning count.

The evaluation event may include optional experiment lineage labels: EVALUATION_EXPERIMENT_ID, EVALUATION_DATASET_VERSION, EVALUATION_PROMPT_VERSION and EVALUATION_CONFIG_VERSION. Model identity comes from the existing normalized provider/model usage metadata.

These are deterministic runtime checks, not LLM-as-a-judge scores. The current FlowPilot workflow runtime executes bounded workflow agents through execute/validate stages and does not produce a general dynamic tool-call trajectory. Tool-selection, argument and agent-plan metrics must not be inferred from these stages. The Evaluation Harness can accept genuine RAGAS/DeepEval agent scores when a runtime later has instrumented tool-call traces.

Reporting is best-effort and cannot change a workflow result, approval state or client response. No workflow input, generated drafts/messages, evidence details, prompts, provider credentials or raw agent traces are sent to the Evaluation Harness. Configure the optional version labels on ai-automation-api only when the corresponding versions are known; leave them blank rather than inventing a version.

About

Production-minded AI automation platform for orchestrated workflows, validation, approvals, persistence, and observability.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages