Lola Execute Workflow icon

Lola Execute Workflow

Execute another workflow with cache options

Lola Execute Workflow

AI-generated

Overview

The Lola Execute Workflow node allows you to execute another n8n workflow dynamically from within your current workflow. It supports loading the target workflow from various sources (database, local file, parameter, or URL) and offers advanced caching options to optimize repeated executions. This node is particularly useful for modularizing complex automations, reusing workflow logic, or orchestrating multiple workflows with shared data.

Practical examples:

  • Running a common data transformation workflow from several other workflows.
  • Executing a workflow stored in a version-controlled JSON file.
  • Fetching and running a workflow definition from a remote server.
  • Caching expensive workflow results to avoid redundant processing.

Properties

Name Meaning
Source Where to get the workflow to execute from. Options: Database (by ID), Local File (from disk), Parameter (JSON code), URL (remote JSON).
Workflow ID The workflow to execute (required if Source is "Database").
Workflow Path The path to local JSON workflow file to execute (required if Source is "Local File").
Workflow JSON The workflow JSON code to execute (required if Source is "Parameter").
Workflow URL The URL from which to load the workflow (required if Source is "URL").
Any data you pass into this node will be output by the Execute Workflow Trigger. More info Informational notice about how input data is passed to the executed workflow.
Cache Output Whether to cache output data. Enables caching of workflow execution results.
TTL Time-to-live in seconds for cached data. Only shown if Cache Output is enabled.
Cache Scope Scope of the cache. Options: Workflow (global across the workflow), Node (local to this node instance). Only shown if Cache Output is enabled.
Cache Store Key The cache key where the output will be stored. Required if Cache Scope is "Workflow". Only shown if Cache Scope is set to "Workflow".

Output

  • The node outputs the result of the executed workflow as an array of items, each with a json property.
  • If caching is enabled and valid, the output may come from the cache rather than a fresh execution.
  • Each output item includes all fields returned by the executed workflow, plus a timestamp field indicating when the workflow was run.
  • In case of error and if "Continue On Fail" is enabled, the output will contain an item with a json object containing an error field describing the error message.

Example output:

[
  {
    "json": {
      "result": "some value",
      "timestamp": "2024-06-01T12:34:56.789Z"
    }
  }
]

or on error (with Continue On Fail):

[
  {
    "json": {
      "error": "The file \"/data/workflow.json\" could not be found."
    }
  }
]

Dependencies

  • File System Access: Required if loading a workflow from a local file.
  • Network Access: Required if loading a workflow from a URL.
  • No external API keys are required unless the executed workflow itself requires them.
  • n8n must have permission to read files at the specified paths and access the specified URLs.

Troubleshooting

Common issues:

  • File Not Found: If the specified local file does not exist, you'll see an error like:
    "The file \"/data/workflow.json\" could not be found."
    Resolution: Check the file path and ensure the file exists and is accessible.
  • Invalid Workflow JSON: If the workflow JSON is malformed, an error will occur during parsing.
    Resolution: Validate your JSON before pasting it into the parameter.
  • Network Errors: If fetching from a URL fails (e.g., due to network issues or invalid URL), an error will be thrown.
    Resolution: Verify the URL and network connectivity.
  • Cache Miss/Expiry: If cache is enabled but expired, the workflow will be re-executed.
    Resolution: Adjust TTL or check cache configuration if unexpected behavior occurs.

Links and References

Discussion