3.0 KiB
3.0 KiB
Execution Artifacts Panel & Demo Action
Date: 2026-03-02
Summary
Added an artifacts panel to the execution detail page that displays artifacts created by an execution, with support for file downloads and interactive progress tracking. Also created a Python example action that demonstrates the artifact system by creating both file and progress artifacts.
Changes
Web UI — Execution Artifacts Panel
New files:
web/src/hooks/useArtifacts.ts— React Query hooks for fetching artifacts by execution ID, individual artifact details (with auto-refresh for progress), and artifact versions. Typed interfaces forArtifactSummary,ArtifactResponse, andArtifactVersionSummarymatching the backend DTOs.web/src/components/executions/ExecutionArtifactsPanel.tsx— Collapsible panel component that:- Lists all artifacts for an execution in a table with type icon, name, ref, size, and creation time
- Shows summary badges (file count, progress count) in the header
- Supports authenticated file download (fetches with JWT, triggers browser download)
- Inline expandable progress detail view with progress bar, percentage, message, and timestamped entry table
- Auto-polls for new artifacts and progress updates while execution is running
- Auto-hides when no artifacts exist (returns
null)
Modified files:
web/src/pages/executions/ExecutionDetailPage.tsx— IntegratedExecutionArtifactsPanelbetween the Workflow Tasks panel and Change History panel. PassesexecutionIdandisRunningprops.
Python Example Pack — Artifact Demo Action
New files:
packs.external/python_example/actions/artifact_demo.yaml— Action definition forpython_example.artifact_demowith parameters for iteration count and API credentialspacks.external/python_example/actions/artifact_demo.py— Python action that:- Authenticates to the Attune API using provided credentials
- Creates a
file_textartifact and aprogressartifact, both linked to the current execution ID - Runs N iterations (default 50), each iteration:
- Appends a timestamped log line and uploads the full log as a new file version
- Appends a progress entry with iteration number, percentage (increments by
100/iterationsper step), message, and timestamp - Sleeps 0.5 seconds between iterations
- Returns artifact IDs and completion status as JSON output
Technical Notes
- Download uses
fetch()withAuthorization: Bearerheader fromlocalStoragesince artifact endpoints require JWT auth — a plain<a href>would fail - Progress artifact detail auto-refreshes every 3 seconds via
refetchIntervalon theuseArtifacthook - Artifact list polls every 10 seconds to pick up new artifacts created during execution
- The demo action uses
ATTUNE_API_URLandATTUNE_EXEC_IDenvironment variables injected by the worker, plus explicit login for auth (sinceATTUNE_API_TOKENis not yet implemented) - Artifact refs include execution ID and timestamp to avoid collisions across runs