Knowledge Base

Flows: Understanding Execution Logs

Articles:

Flows: Understanding Execution Logs

The Flow Execution Logs in Ligantic provide a comprehensive view into the execution of your Flows. This user guide will cover key topics to help you understand and leverage the Execution Logs, including Flow version control, execution status monitoring, token usage tracking, and customisable logging levels. With these insights, you can effectively troubleshoot issues, optimise Flow performance, and gain deeper visibility into your Ligantic platform.

You can view the Flow Execution by navigating to "Space Settings > Flows" and clicking the "View Executions" section for each Flow.

Flow Execution User Interface

The "Flow Execution" interface of the Ligantic platform has several key components:

  1. Flow Version: This shows the current version of the Flow along with the Version Status. The Version Status can be either "Draft", "Published" or "Superseded".
  2. Status: The status of the Flow Execution Status. The Flow Execution Status can be either "Pending", "Executing", "Succeeded", "Failed" or "Cancelled".
  3. Log Level: The log level shows the level of logging that was set for the Execution. This can be set on a per Execution basis or leverage the Default Logging Level set for the Flow. The Log Level can be either "None", "Error", "Warn", "Info" or "Debug".
  4. Total Token Usage: This outlines the total Ligantic Tokens that were used to Execute this Flow.
  5. Re-execute: This is a dropdown button that allows you to Re-execute the Flow or copy the Flow inputs into a new Execution.
  6. Trigger Node: This identified the Trigger Node that was used to trigger this Flow. You can have one or many Trigger Nodes in a Flow.
  7. Inputs: This table shows all of the Inputs including their ID, Label, and Value that were fed into the Trigger Node of the Flow or Internal Flow Nodes.
  8. Outputs: This table shows all of the Outputs including their ID, Label, and Value that were produced out of the Flow or internal Flow Nodes. Outputs are produced by the "Flow: Result", "UX: Action" and "UX: Message" Nodes.
  9. Log Details: This table shows all of the logs from the Execution. The level of information in this table depends on the Log Level used for the Execution. Each log includes a Timestamp, Level indicator, Message, Extra Information from the log, and Span.

Flow Version Control

The Ligantic Flow Designer incorporates industry-standard version control mechanisms to ensure the observability and stability of your solutions. Whenever a Flow is saved, the platform automatically increments the version number, allowing you to access and review previous iterations of the Flow as needed. This version control system provides a transparent audit trail of changes made to your Flows over time.

Every Flow Execution logs the specific version number used in the execution, enabling you to easily trace the state of the system at the time of execution. This level of versioning and logging empowers you to make controlled, reliable changes to your solutions on the Ligantic Platform, confident that you can revert to previous versions or understand the context of past executions if required.

Execution Status

The Flow Execution Status provides a clear indication of the current state of a flow's execution.

The status can take on one of five values:

  • Pending - The Flow has been triggered but has not yet begun executing. This is the initial state when a Flow is first started.
  • Executing - The Flow is currently running and processing its steps.
  • Succeeded - The Flow has completed all of its steps required in the Control flow and completed successfully.
  • Failed - One or more steps in the Flow encountered an error, causing the overall execution to fail.
  • Cancelled - The flow execution was manually stopped or cancelled before completion.

The Flow Execution Status allows users to quickly see where a Flow is at in its lifecycle and identify any issues that may have occurred during the run. This status can also be accessed programmatically through the Ligantic API.

Token Usage

Ligantic Tokens are the billing mechanism used in the Ligantic Platform. Each Flow Execution on Ligantic consumes a certain number of tokens, which are deducted from the nominated Billing Account for that Space (either the User or the Space Owner). You can read more about the Ligantic Tokens and Billing Configuration here. The exact number of Ligantic Tokens consumed per execution depends on factors such as the complexity of the Flow, the Capabilities used, and the length of any inputs or outputs generated by Large Language Models (LLMs).

A Flow Execution costs between 10 and 40 tokens depending on your Ligantic Subscription Model. Then any additional steps or token calculations from the Flow Execution are added onto this base amount to calculate the Total Token Usage. The Total Token Usage is always shown at the top of the Flow Execution page, providing a clear summary of the overall tokens consumed.

Step-by-Step Token Usage in the Log Details

When the "Debug" Log Level is selected, the Log Details table outlines the exact token usage for each step in the Flow Execution. This gives users the ability to explore and understand the costs associated with each Flow Node, and optimise the capabilities and configurations that make the most sense for their Flows.

In this example, this step in the Flow Execution cost a total of 2 Ligantic Tokens. This is driven by a calculation against the Execution step costs, in this case an external call to the Ada Embedding Model, and your subscription multiplier.

Log Levels

The system provides a range of log levels that can be configured to control the amount and type of information captured during the execution of a Flow. The default log level can be set at the Flow level, which will apply to all executions of that Flow.

A specific Log Level can also be configured on a per-execution basis, allowing users to adjust the logging behaviour for individual runs as needed.

To access a single execution you can click the "Create Execution" from the "Flow Execution" page. From the "New Execution" page you can choose the Log Level for this single execution or leave it as the configured Flow Default.

The available log levels are:

  • None: The none log level does not record any logs or messages. This level is used when you do not want to capture any logging information from the system.
  • Error: The error log level is used to issues or failures that have occurred during the execution. Errors indicate that something has gone wrong during the execution and that the Flow may not be functioning as expected.
  • Warn: The warn log level is used to record potential issues or situations that may require some attention, but are not as severe as errors. Warnings indicate that there may be something that needs to be investigated or addressed within the Flow, but the execution is still functioning as expected.
  • Info: The info log level is used to record general informational messages about the normal operation of the Flow execution. These are not necessarily errors or warnings, but provide useful information about the system's state and activities. Info logs are helpful for understanding the overall behaviour and status of the Flow Execution.
  • Debug: The debug log level is used to record the most detailed information about the Flow execution. This level logs everything, including low-level details and intermediate steps, and is typically used during development or troubleshooting to capture comprehensive data that can help identify and resolve issues. Debug logs are essential for in-depth analysis and problem-solving.

Inputs and Outputs

The Flow Execution page provides visibility into the data that flows through your Flows. The Inputs section shows the data that was fed into the Flow when it was triggered, capturing the initial values that were used to start the Flow Execution. This allows you to observe and understand what information was used to kick off the Flow.

The Outputs section then displays the results, actions, and messages that were generated as the Flow executed. These outputs are produced by specific nodes in your Flow, like the "Flow: Result", "UX: Action", and "UX: Message" nodes. The outputs can be viewed on the Flow Execution page, passed to subsequently triggered Flows, or accessed programmatically through the Ligantic API. Together, the inputs and outputs give you full transparency into the data flowing into and out of your Flows.

Log Details

The Log Details table contains all the logs from a Flow Execution. The number and detail of the log entries will depend on the Log Level selected for the Flow Execution.

Each log entry contains the following information:

  • Timestamp: This shows the UTC time of the Flow Execution step.
  • Level: This denotes the type of log - it can be either "Error", "Warn", "Info" or "Debug".
  • Message: This contains the high-level details of the execution step. It often references the Node that is executing the step, shown as "Type:SubType(if Applicable):Node:Id" and the title of the step being executed. For example, "ai:llm:chatMessage:f570 variables".
  • Extra: This column details the extra information from the message. It often contains a JSON object with all the content from the variables of the Node.
  • Span: This is the breadcrumb of node IDs that triggered the current node, all the way up from the trigger node. It shows the parent on the control flow. For example, "-" means the log is from the trigger node, and "_.1295" means it was triggered by node "1295" which was triggered from the initial trigger node. The span information makes the entire control flow traversable and understandable in the execution order, even if multiple processes are happening concurrently in a single Flow.

Powered by Ligantic