Add Poimen-specific REST endpoints to the API gateway. The generic /workflow action dispatch works but is untyped and clunky for frontend consumption.
New Endpoints
POST /v1/poimen/plan — call PlannerActivity, return DAG
POST /v1/poimen/execute — start DAGWorkflow with DAG input
GET /v1/poimen/executions — list Poimen workflow executions
GET /v1/poimen/executions/:id — describe execution + status
GET /v1/poimen/executions/:id/history — get activity event history
POST /v1/poimen/executions/:id/signal — signal (pause/resume/cancel)
DELETE /v1/poimen/executions/:id — terminate workflow
Request/Response Contracts
POST /v1/poimen/plan
// Request
{"message":"scan repo for vulnerabilities and deploy if clean","context":{"repo":"https://github.com/...","branch":"main"}}// Response
{"dag":{"nodes":[{"id":"clone","activity":"CloneRepoActivity","params":{}}],"edges":[{"source":"clone","target":"scan"}]},"name":"security-scan-deploy"}
All endpoints require Authorization: Bearer <JWT> (Authentik)
Extract sub from JWT as tenant/user ID
/plan calls PlannerActivity directly (not via Temporal) for low latency
/execute starts DAGWorkflow via Temporal gRPC
Filter executions by user (sub claim) for tenant isolation
Dependencies
poimen-workflows: PlannerActivity (B1) for /plan
poimen-workflows: DAGWorkflow (B2) for /execute
## Description
Add Poimen-specific REST endpoints to the API gateway. The generic `/workflow` action dispatch works but is untyped and clunky for frontend consumption.
## New Endpoints
```
POST /v1/poimen/plan — call PlannerActivity, return DAG
POST /v1/poimen/execute — start DAGWorkflow with DAG input
GET /v1/poimen/executions — list Poimen workflow executions
GET /v1/poimen/executions/:id — describe execution + status
GET /v1/poimen/executions/:id/history — get activity event history
POST /v1/poimen/executions/:id/signal — signal (pause/resume/cancel)
DELETE /v1/poimen/executions/:id — terminate workflow
```
## Request/Response Contracts
### POST /v1/poimen/plan
```json
// Request
{"message": "scan repo for vulnerabilities and deploy if clean", "context": {"repo": "https://github.com/...", "branch": "main"}}
// Response
{"dag": {"nodes": [{"id": "clone", "activity": "CloneRepoActivity", "params": {}}], "edges": [{"source": "clone", "target": "scan"}]}, "name": "security-scan-deploy"}
```
### POST /v1/poimen/execute
```json
// Request
{"dag": {}, "namespace": "default", "task_queue": "poimen-worker"}
// Response
{"workflow_id": "dag-abc123", "run_id": "run_xyz", "started_at": "2025-01-01T00:00:00Z"}
```
## Implementation Notes
- All endpoints require `Authorization: Bearer <JWT>` (Authentik)
- Extract `sub` from JWT as tenant/user ID
- `/plan` calls PlannerActivity directly (not via Temporal) for low latency
- `/execute` starts `DAGWorkflow` via Temporal gRPC
- Filter executions by user (`sub` claim) for tenant isolation
## Dependencies
- poimen-workflows: PlannerActivity (B1) for `/plan`
- poimen-workflows: DAGWorkflow (B2) for `/execute`
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Description
Add Poimen-specific REST endpoints to the API gateway. The generic
/workflowaction dispatch works but is untyped and clunky for frontend consumption.New Endpoints
Request/Response Contracts
POST /v1/poimen/plan
POST /v1/poimen/execute
Implementation Notes
Authorization: Bearer <JWT>(Authentik)subfrom JWT as tenant/user ID/plancalls PlannerActivity directly (not via Temporal) for low latency/executestartsDAGWorkflowvia Temporal gRPCsubclaim) for tenant isolationDependencies
/plan/execute