Skip to content

API Service

The Kubernetes API image hosts the standard Flow-Like API router plus deployment-specific health probes and a separate metrics listener. It does not add a second /jobs/* API.

Flow-Like Kubernetes architecture showing the web and API services, state services, execution choices, optional compiler, and observability

| Surface | Default port | Purpose | |---|---:|---| | /api/v1/* | 8080 | Standard Flow-Like hub, app, event, execution, registry, sink, and administration routes | | /health/live | 8080 | Kubernetes liveness probe | | /health/ready | 8080 | Kubernetes readiness probe | | /health/startup | 8080 | Kubernetes startup probe | | /swagger-ui | 8080 | Interactive API documentation | | /api-doc/openapi.json | 8080 | Generated OpenAPI document | | /r/* and /m/* | 8080 | Registered inbound REST and MCP routes; each registration enforces its own authorization | | /metrics | 9090 | Prometheus metrics listener |

The main router's /api/v1/execution/* routes report and query runs. Workflow invocation is exposed through app and event routes, then dispatched through the configured execution backend.

| Dependency | Role | |---|---| | PostgreSQL or CockroachDB | Durable API state, apps, events, runs, and registry metadata | | Redis | Shared queue/cache coordination used by the configured backend | | Object storage | Content, metadata, and registry artifacts | | Executor pool | Runs workflows through the implemented HTTP executor path | | Compiler, when enabled | Builds platform-specific WASM artifacts |

The API constructs the shared Flow-Like router, starts the run sweeper, and initializes object storage before it begins listening.

The API can create Kubernetes Job objects, but the checked-in executor's job-once entrypoint is a placeholder that exits. Treat kubernetes_job as an incomplete dispatch path, not an alternative runtime dependency.

| Component | Location | |---|---| | Kubernetes entry point | apps/backend/kubernetes/api/src/main.rs | | Environment configuration | apps/backend/kubernetes/api/src/config.rs | | Kubernetes probe handlers | apps/backend/kubernetes/api/src/health.rs | | Metrics listener | apps/backend/kubernetes/api/src/metrics.rs | | Object-store adapter | apps/backend/kubernetes/api/src/storage.rs | | Shared API router | packages/api/src/lib.rs | | Execution dispatch | packages/api/src/execution/ |

The Helm chart injects:

  • DATABASE_URL and REDIS_URL;
  • storage provider settings and credentials;
  • execution JWT keys;
  • execution-backend and executor settings;
  • PORT=8080 and METRICS_PORT=9090.

PORT is configurable in the binary, but the chart intentionally fixes the container HTTP port at 8080 and maps the API Service to it. Storage-specific requirements are covered in Storage Configuration.

Terminal window
kubectl port-forward service/flow-like-api 8083:8080 -n flow-like

In another terminal:

Terminal window
curl -fsS http://localhost:8083/health/live
curl -fsS http://localhost:8083/api/v1/health

Port forwarding is for operator access and development. Use an authenticated Ingress or another controlled edge for persistent external access.

The chart defaults to one API replica with autoscaling disabled.

| Value | Default | |---|---:| | api.replicaCount | 1 | | api.autoscaling.enabled | false | | api.autoscaling.minReplicas | 1 | | api.autoscaling.maxReplicas | 10 | | CPU target | 70% | | Memory target | 80% |

When autoscaling is enabled, the chart omits the Deployment replica count and creates an HPA. Confirm that the cluster metrics API is available before enabling it.

Terminal window
kubectl logs deployment/flow-like-api -n flow-like --tail=100
kubectl logs deployment/flow-like-api -n flow-like --follow
kubectl rollout status deployment/flow-like-api -n flow-like