Skip to main content

Load Artifact

Loads an artifact from the session's artifact storage and saves it to a local file.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.

Inputs

  • Session ID - (string) Unique identifier for the session where the artifact is stored.
  • Artifact Filename - (string) Name of the artifact to load. Use "user:" prefix for user-scoped artifacts (e.g., "user:profile.jpg").
  • Version - (number) Specific version to load. Leave empty to load the latest version.
  • Output File Path - (string) Path where the loaded artifact will be saved.

Outputs

  • Output File Path - (string) Path to the saved artifact file.
  • Version - (number) Version number of the loaded artifact.

How It Works

The Load Artifact node retrieves files from the session's artifact service:

  1. Artifact Retrieval - Fetches the artifact from the session's artifact service using the filename and optional version
  2. Version Resolution - If no version is specified, loads the latest version
  3. Directory Creation - Ensures the output directory exists
  4. File Writing - Writes the artifact data to the specified output file path
  5. Output Setting - Sets the output variables with the file path and version number

Common Use Cases

  • Agent Input - Load previously saved files for agent processing
  • File Recovery - Retrieve files saved in earlier workflow steps
  • Version Management - Load specific versions of artifacts
  • Data Retrieval - Access stored data files for analysis
  • User Content - Load user-specific files across sessions
  • Workflow Continuity - Pass files between different workflow stages

Error Handling

The node will return errors in the following cases:

  • Missing required fields - "Session ID and Filename are required"
  • Artifact not found - "Artifact 'filename' not found"
  • Invalid version - Specified version does not exist
  • Invalid artifact data - Artifact has no inline data
  • File write error - Cannot write to the output file path
  • Permission errors - Insufficient permissions to write the file
  • Directory creation failure - Cannot create the output directory

Usage Notes

  • Version Management - If Version is not specified, the latest version is automatically loaded
  • Output Path - The node automatically creates any necessary parent directories for the output file
  • User-Scoped Artifacts - Prefix the filename with "user:" to load user-specific artifacts that persist across sessions
  • Session-Scoped Artifacts - Regular filenames (without "user:" prefix) load session-specific artifacts
  • File Overwriting - If the output file already exists, it will be overwritten
  • Version Output - The Version output indicates which version was loaded, useful when not specifying a version
  • Empty Output Path - If Output File Path is not provided, the artifact is loaded but not saved to disk (only version is output)

Version Handling

  • Latest Version: Leave the Version input empty to automatically load the most recent version
  • Specific Version: Provide a version number (e.g., 1, 2, 3) to load a specific version
  • Version Tracking: Each save operation increments the version number

Example Usage

Loading the latest version:

  • Session ID: "session-123"
  • Artifact Filename: "report.pdf"
  • Version: (empty)
  • Output File Path: "/tmp/report.pdf"

Loading a specific version:

  • Session ID: "session-123"
  • Artifact Filename: "data.json"
  • Version: 2
  • Output File Path: "/tmp/data_v2.json"

Loading user-scoped artifact:

  • Session ID: "session-123"
  • Artifact Filename: "user:profile.jpg"
  • Version: (empty)
  • Output File Path: "/tmp/user_profile.jpg"