Skip to content

Add workflow export bundle API endpoint with artifact existence flags#163

Closed
akgohain wants to merge 1 commit intomainfrom
codex/add-backend-endpoint-to-export-workflow-bundle-drjb5b
Closed

Add workflow export bundle API endpoint with artifact existence flags#163
akgohain wants to merge 1 commit intomainfrom
codex/add-backend-endpoint-to-export-workflow-bundle-drjb5b

Conversation

@akgohain
Copy link
Copy Markdown
Collaborator

Motivation

  • Provide a backend endpoint to export a reproducible workflow bundle containing session snapshot, chronological events, and referenced artifact pointers.
  • Ensure the export is deterministic and self-describing with a schema version and timestamp.
  • Represent missing artifact files safely (boolean exists) instead of hard-failing.
  • Reuse existing workflow DB models/serializers and avoid frontend changes.

Description

  • Add Pydantic response models in server_api/workflow/models.py for WorkflowExportBundle, WorkflowSessionSnapshot, WorkflowEvent, and ArtifactReference.
  • Implement POST /api/workflows/{workflow_id}/export-bundle in server_api/workflow/router.py to load EHToolSession and EHToolLayer, build ordered events, deduplicate artifact paths, and return exists flags using os.path.exists.
  • Events are timestamped and sorted so returned events are chronological and deterministic.
  • Register the new workflow router in server_api/main.py and add unit tests in tests/test_workflow_export_bundle.py covering the happy path and missing-artifact behavior.

Testing

  • Ran uv run pytest -q tests/test_workflow_export_bundle.py which failed in this environment due to editable package metadata resolution for pytorch_connectomics.
  • Ran PYTHONPATH=. uv run --no-project pytest -q tests/test_workflow_export_bundle.py which passed (2 passed).

Codex Task

@akgohain
Copy link
Copy Markdown
Collaborator Author

Consolidated into draft PR #165 (feat/codex-wave-integration). Closing this source draft to keep review in one place.

@akgohain akgohain closed this Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant