Overview
ThegenerateExecutionLogsActivity creates log entries in the database to track workflow executions. These logs are used for debugging, auditing, and monitoring workflow performance.
Purpose
- Track workflow execution history
- Record success and failure information
- Store error stack traces for debugging
- Maintain execution metadata for analysis
- Enable workflow auditing and compliance
When itβs executed
This activity is called at two key points:- After successful execution: Logs successful node completion with execution details
- On error: Logs error information including stack traces and error messages
Signature
Inputs
| Parameter | Type | Description |
|---|---|---|
nodeId | string | ID of the node being logged |
flowId | string | ID of the flow containing the node |
userId | string | ID of the user executing the workflow |
sessionId | string | Session identifier for tracking execution context |
message | string | Log message describing the execution result |
errorStack | any | Error stack trace (null for successful executions) |
metadata | any | Additional metadata about the execution (typically node data) |
isError | boolean | Flag indicating whether this is an error log |
Outputs
Returnsvoid. The activity completes when the log entry is successfully created.
Implementation details
The activity inserts a record into theexecution_logs table with the following structure:
nodeId: Node identifierflowId: Flow identifieruserId: User identifiersessionId: Session identifiermessage: Log messageerrorStack: Error stack trace (nullable)metadata: JSON metadata (typically node configuration)isError: Boolean error flag
Example usage in workflow
Success logging
Error logging
Log structure
Each log entry contains:- Execution context:
nodeId,flowId,userId,sessionId - Result information:
message,isError - Debugging data:
errorStack,metadata
Error handling
The activity may throw an error if:- Database connection fails
- The insert query fails
- Required fields are missing
Use cases
Execution logs are used for:- Debugging: Understanding why workflows failed
- Monitoring: Tracking workflow success rates
- Auditing: Maintaining execution history
- Analytics: Analyzing workflow performance
- Troubleshooting: Identifying patterns in failures