add taskv2 and task id to artifacts by default if present in context (#2770)

This commit is contained in:
Shuchang Zheng
2025-06-23 11:16:45 +08:00
committed by GitHub
parent 35c30d1a4a
commit 20c495089a

View File

@@ -42,11 +42,13 @@ class ArtifactManager:
if data and path:
raise ValueError("Both data and path cannot be provided to create an artifact.")
if not workflow_run_id:
context = skyvern_context.current()
if context:
workflow_run_id = context.workflow_run_id
context = skyvern_context.current()
if not workflow_run_id and context:
workflow_run_id = context.workflow_run_id
if not task_v2_id and context:
task_v2_id = context.task_v2_id
if not task_id and context:
task_id = context.task_id
artifact = await app.DATABASE.create_artifact(
artifact_id,