PromptLayer Run Agent icon

PromptLayer Run Agent

Run an Agent from the PromptLayer API

PromptLayer Run Agent

AI-generated

Overview

This node executes an Agent from the PromptLayer API, allowing users to run specific versions or labeled versions of an Agent with customizable input variables and metadata. It is useful for automating workflows that require running AI or automation agents managed via PromptLayer, such as processing data, generating outputs, or integrating AI-driven tasks within an n8n workflow.

Use Case Examples

  1. Running a specific version of an Agent by version number with input variables to process data.
  2. Executing an Agent using a label name to run a particular labeled version with metadata and timeout settings.
  3. Returning all outputs from an Agent execution for detailed analysis or further processing.

Properties

Name Meaning
Agent Name or ID The name or ID of the Agent to execute, selectable from a list or specified via expression.
Use Agent Label Name Boolean flag to choose whether to use an Agent label name instead of a version number.
Agent Version Number Specify the version number of the Agent to run a specific version. Shown only if 'Use Agent Label Name' is false.
Agent Label Name Specify the label name of the Agent to run a specific labeled version. Shown only if 'Use Agent Label Name' is true.
Input Variables A JSON dictionary of input variables required by the Agent.
Additional Fields Optional additional settings including metadata (JSON key-value pairs), whether to return all outputs, and execution timeout in minutes.

Output

JSON

  • workflow_version_execution_id - The unique execution ID of the Agent run.
  • body - The full JSON response body from the Agent execution result, including outputs.

Dependencies

  • PromptLayer API with an API key credential

Troubleshooting

  • Invalid JSON in Input Variables or Metadata will cause errors; ensure valid JSON format.
  • Execution may time out if the Agent takes longer than the specified timeout (default 10 minutes).
  • Unexpected HTTP status codes from the API will throw errors; check API key validity and network connectivity.

Links

Discussion