Workflow Review
Apply stored rulebooks to reusable indexed evidence and read findings.
This guide shows you how to create a rulebook, bind it to a workflow, run it, and read the resulting findings.
The workflow surface separates reusable rules from a selected video set. MANAGE_RULEBOOKS controls rulebooks and workflows.
Rulebooks
Create a rulebook with both content and rules:
curl --fail-with-body -X POST "$BASE_URL/api/v1alpha1/rulebooks" \
-H "Authorization: Bearer $DEEPFRAME_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: rulebook-create-01" \
-d '{
"name": "Warehouse Safety",
"content": "Inspect every emergency exit.",
"rules": [
{"id":"SEC-04","title":"Emergency exit is clear.","description":"The exit remains unobstructed."}
]
}'Use GET /api/v1alpha1/rulebooks and GET /api/v1alpha1/rulebooks/{rulebook_id} to read rulebooks. PATCH /api/v1alpha1/rulebooks/{rulebook_id} changes the editable rulebook. DELETE /api/v1alpha1/rulebooks/{rulebook_id} returns 204.
CSV Import
Preview a CSV without an idempotency header:
curl --fail-with-body -X POST "$BASE_URL/api/v1alpha1/rulebooks/csv-imports/preview" \
-H "Authorization: Bearer $DEEPFRAME_API_KEY" \
-H "Content-Type: application/json" \
-d '{"csv_text":"Section,Rule ID,Requirement\nSafety,SEC-04,Emergency exit is clear."}'Confirm a valid preview with POST /api/v1alpha1/rulebooks/csv-imports and an Idempotency-Key. The preview has an expiry; import it before that time.
Workflows
A workflow binds a rulebook, a template type, and an optional source list:
curl --fail-with-body -X POST "$BASE_URL/api/v1alpha1/workflows" \
-H "Authorization: Bearer $DEEPFRAME_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: workflow-create-01" \
-d '{
"name": "Warehouse safety review",
"rulebook_id": "rb_0190b5d4-7e1f-7a2b-9c3d-1234567890ab",
"template_type": "media_review",
"source_ids": ["vid_0190b5d4-7e1f-7a2b-9c3d-1234567890ab"],
"playbook": "Review every indexed scene.",
"output_modes": ["report"],
"status": "draft"
}'The accepted template_type values are media_review, content_review, and retail_store_operations. The accepted output_modes values are case, report, and evidence_bundle.
The workflow stores the source ids visible at creation. A run may pass an explicit source_snapshot when the source set must be frozen for that run. Start a run with POST /api/v1alpha1/runs and workflow_id.
Run And Review
Poll the run until its top-level status is completed, failed, or canceled. Read workflow findings with GET /api/v1alpha1/findings?run_id={run_id}. Findings retain rule provenance and evidence result states. See Runs And Status and Findings, Answers, And Reports.