Overview
This node is designed to keep a concurrency lock alive for a workflow by refreshing its time-to-live (TTL) in a Redis store. It is useful in scenarios where workflows require exclusive access or coordination, and the lock must be maintained to prevent other processes from interfering while the workflow is running. For example, if a workflow manages shared resources or critical sections, this node can periodically extend the lock duration to ensure uninterrupted execution.
Properties
| Name | Meaning |
|---|---|
| Namespace | Redis namespace to group keys, e.g., "executions" or "workflows:executions". |
| Workflow ID | The unique identifier of the workflow, typically the current workflow's ID (${workflow.id}). |
| TTL (Seconds) | Time-to-live for the lock in seconds; how long the lock should remain valid before expiring. |
Output
The node outputs a JSON object containing:
workflowId: The workflow ID for which the lock was refreshed.lastUpdate: A timestamp string indicating when the lock was last updated, formatted asYYYY/MM/DD HH:mm.
Example output JSON:
{
"workflowId": "123456",
"lastUpdate": "2024/06/15 14:30"
}
No binary data is produced by this node.
Dependencies
- Requires a Redis server accessible with provided credentials (host, port, password).
- The node expects an API key or authentication token configured in n8n credentials for connecting to Redis.
- Uses the
ioredislibrary internally to interact with Redis.
Troubleshooting
- Missing Redis Credentials: If Redis credentials are not set or invalid, the node will throw an error indicating missing credentials. Ensure that Redis connection details are correctly configured in n8n.
- Empty Workflow ID or Namespace: The node validates that both the workflow ID and namespace are non-empty strings. Providing empty values will cause errors. Verify these inputs before execution.
- Redis Connection Issues: Network problems or incorrect Redis host/port/password may cause connection failures or timeouts. Check connectivity and credential correctness.
- TTL Misconfiguration: Setting a very low TTL might cause the lock to expire prematurely. Adjust the TTL value according to your workflow's expected execution time.