Execution & Debugging
This guide covers how to debug workflows in NebulaFlow, including inspecting intermediate results, monitoring execution, and troubleshooting common issues.
Overview
NebulaFlow provides several debugging tools to help you understand and fix workflow behavior:
- Preview Nodes: Display intermediate data at any point in your workflow
- Single-Node Execution: Test individual nodes without running the entire workflow
- Execution Logs: Real-time status updates and streaming output
- Token Counting: Monitor LLM usage and costs
- Approval System: Inspect and approve/reject CLI commands and LLM tool calls
- Pause & Resume: Debug long-running workflows by pausing and resuming
- Environment Flags: Enable verbose logging for specific components
Preview Nodes
Preview nodes are the primary debugging tool. They display the output of any connected node without affecting the workflow flow.
Using Preview Nodes
- Add a Preview Node: Drag a Preview node from the Library (under Preview category)
- Connect: Connect any node’s output to the Preview node’s input
- View Results: After execution, click the Preview node to see its content
Best Practices
- Place checkpoints: Add Preview nodes after each major transformation
- Inspect inputs: Connect Preview nodes before complex nodes to verify inputs
- Multiple inputs: Preview nodes can receive from multiple parents (fan-in)
- Edit content: Preview nodes have an “Edit” tab to modify displayed content
Example
Input → LLM → Preview → Variable → Preview
The first Preview shows the LLM’s raw output, the second shows the stored variable value.
Single-Node Execution
Test nodes individually without executing the entire workflow.
How to Execute a Single Node
- Right-click on a node in the workflow graph
- Select “Execute Node” from the context menu
- Provide inputs if the node requires them (optional)
- View results in the node’s output area or connected Preview nodes
Use Cases
- Debug LLM prompts: Test prompt templates with different inputs
- Verify CLI commands: Test shell commands before adding them to a workflow
- Check condition logic: Test If/Else conditions with various inputs
- Inspect variable values: See what a Variable node would store
Limitations
- Single-node execution does not propagate to downstream nodes automatically
- Loop structures require full workflow execution
- Some nodes (like Loop Start/End) need the full workflow context
Execution Logs & Status
During execution, NebulaFlow provides real-time feedback through the webview interface.
Node Status Indicators
- Pending (gray): Node waiting for dependencies
- Running (blue): Node currently executing
- Completed (green): Node finished successfully
- Error (red): Node failed with an error
- Pending Approval (yellow): Node waiting for user approval
Streaming Output
LLM Nodes: Stream token-by-token as the model generates content. You can see the response in real-time.
CLI Nodes: Stream stdout and stderr as the command runs. Output appears in the node’s output area.
Execution Events
The extension sends events to the webview for each node:
node_execution_status: Status updates
node_assistant_content: LLM streaming content
node_output_chunk: CLI output chunks
execution_completed: Workflow finished
Token Counting
Monitor LLM usage to understand costs and optimize prompts.
Automatic Token Counting
- Preview Nodes: Automatically calculate token count for displayed content
- LLM Nodes: Track input and output tokens per execution
- Display: Token count appears in the node’s result area (when available)
Viewing Token Counts
- Execute a workflow with LLM nodes
- Check Preview nodes for token count display
- Inspect node results in the Right Sidebar
Optimization Tips
- Reduce prompt size: Remove unnecessary context
- Use appropriate models: Smaller models for simple tasks
- Cache outputs: Reuse LLM outputs when possible
- Batch operations: Combine multiple small requests
Approval System Debugging
CLI nodes and LLM tool calls can require approval before execution. This is a security feature that also aids debugging.
Approval Flow
- Node reaches approval point: Execution pauses
- Right Sidebar shows preview: Command/script and structured summary
- Review details: Mode, Shell, Safety, Stdin, Flags
- Approve or Reject: Continue or stop execution
Debugging Approval Issues
CLI node not executing:
- Check Safety setting (safe vs advanced)
- Verify Approval is enabled (default for safe mode)
- Look for “Pending Approval” status indicator
LLM tool calls blocked:
- Check
dangerouslyAllowAll setting in workspace configuration
- Review
tools.disable array
- Verify tool call is expected behavior
Pause & Resume
For long-running workflows, you can pause execution and resume later.
Pausing a Workflow
- Click “Pause” button during execution
- Execution stops at the current node
- State is saved automatically
Resuming from Pause
- Click “Resume” button
- Choose starting point: Resume from paused node or specific node
- Provide seeds (optional): Override outputs, decisions, or variables
Debugging with Pause
- Test specific sections: Pause before a problematic node, then resume
- Inspect state: Check variable values and node outputs before resuming
- Modify inputs: Change workflow data before resuming
Environment Variables for Debugging
Set these environment variables to enable additional debugging features.
Debug Flags
NEBULAFLOW_DEBUG_LLM: Set to 1 to enable verbose logging for LLM node execution
NEBULAFLOW_DISABLE_HYBRID_PARALLEL: Disable hybrid parallel execution (affects looped graphs)
NEBULAFLOW_FILTER_PAUSE_SEEDS: Filter pause seeds in certain resume scenarios
NEBULAFLOW_SHELL_MAX_OUTPUT: Maximum characters to capture from shell command output (default: 1000000)
Setting Environment Variables
Linux/macOS:
export NEBULAFLOW_DEBUG_LLM=1
Windows (PowerShell):
$env:NEBULAFLOW_DEBUG_LLM=1
Using .env file:
Create a .env file in your workspace root:
Troubleshooting Common Issues
Workflow Doesn’t Execute
Symptom: Clicking “Execute” does nothing
Causes:
- Missing API key (
AMP_API_KEY not set)
- Invalid workflow structure (missing connections)
- Node validation errors
Solution:
- Check environment variables are set
- Verify all nodes have required connections
- Check node configuration for errors
Node Stuck in “Pending” State
Symptom: Node never starts executing
Causes:
- Missing dependencies (parent nodes not completed)
- Circular dependencies
- Node disabled
Solution:
- Check in-degree (number of incoming edges)
- Verify all parent nodes completed successfully
- Ensure node is not disabled (check node settings)
LLM Node Timeout
Symptom: LLM node times out after 300 seconds
Causes:
- Slow model response
- Large context window
- Network issues
Solution:
- Increase timeout in node configuration
- Try a faster model
- Reduce prompt size
- Check API key validity
CLI Node Command Fails
Symptom: Shell command exits with error
Causes:
- Command not found in PATH
- Incorrect shell selection
- Safety sanitization blocking valid commands
Solution:
- Verify command exists in system PATH
- Check shell configuration (bash, zsh, pwsh, etc.)
- Review safety settings (safe vs advanced mode)
- Check approval requirements
Preview Node Shows Nothing
Symptom: Preview node is empty after execution
Causes:
- No data reaching the node
- Node not executed (dependency issue)
- Data is empty string
Solution:
- Check upstream nodes completed successfully
- Add another Preview node before to inspect data flow
- Verify connections are correct (source/target handles)
Token Count Not Displayed
Symptom: No token count shown for LLM output
Causes:
- Token counting not implemented for that model
- Output too large (truncated)
- Feature not yet available
Solution:
- Check node result area for token count
- Use Preview node to see raw output
- Monitor execution logs for token-related messages
Best Practices for Debugging
Incremental Development
- Build small: Start with simple linear workflows
- Test each node: Execute nodes individually before connecting
- Add Preview nodes: Place checkpoints at each stage
- Verify outputs: Check each node’s result before proceeding
Systematic Approach
- Isolate the problem: Identify which node is failing
- Check inputs: Verify data reaching the node
- Check configuration: Review node settings
- Check dependencies: Ensure parent nodes completed
- Check logs: Review execution status and errors
Common Patterns
Debug LLM prompts:
Input → Preview (check input) → LLM → Preview (check output)
Debug CLI commands:
Input → CLI → Preview (check output) → Next step
Debug condition logic:
Input → Preview (check value) → If/Else → Preview (true path)
→ Preview (false path)
Advanced Debugging
Inspecting Execution State
The extension maintains execution state that can be inspected:
- Node outputs: Stored in
nodeResults map
- Variable values: Stored in
variableValues map
- Loop states: Current iteration and max iterations
- LLM thread IDs: For chat continuation
Debugging Parallel Execution
NebulaFlow uses parallel execution by default. To debug parallel issues:
- Disable hybrid parallel: Set
NEBULAFLOW_DISABLE_HYBRID_PARALLEL=1
- Add Preview nodes: After parallel branches to inspect outputs
- Check edge ordering: Ensure inputs arrive in correct order
Debugging Subflows
Subflows have their own execution context:
- Open subflow: Double-click subflow node
- Debug internally: Use same debugging techniques inside subflow
- Check ports: Verify input/output port mappings
See Also