Miiflow Docs

Code Node

The Code Node executes custom Python scripts within your workflow.

Overview

Use Code Nodes when you need:

  • Custom data transformations
  • Complex logic not available in other nodes
  • Integration with Python libraries
  • Data parsing or formatting

Configuration

Python Code

Write your Python script in the code editor:

# Access input variables
user_input = inputs.get("text", "")
 
# Process data
result = user_input.upper()
 
# Return output
return {"processed_text": result}

Input Variables

Define which variables are passed to your script.

Available Features

  • Standard Python libraries
  • JSON parsing
  • String manipulation
  • Mathematical operations
  • Regular expressions

Output

Return a dictionary that becomes available to downstream nodes.

Best Practices

  1. Handle edge cases and empty inputs
  2. Keep scripts focused and simple
  3. Use descriptive variable names
  4. Add comments for complex logic