AgenticFlow AI: ChatGPT in the Flow of Work
HomeCommunityDiscordLogin
  • Get Started
    • AgenticFlow - the OS for your AI Workforce
    • llms.txt
    • FAQs
    • Key Concepts
      • Workflows
      • Templates
      • Data
      • Agent
      • API Keys
      • AgenticFlow MCP
    • Workflows quickstart
    • Agents quickstart
    • Introduction to Large Language Models
    • Plans and Credits
    • System Quotas
    • Affiliate program đź’µ
  • AGENTS
    • Introduction to agents
    • Agent Templates
    • Create an Agent
    • Customize an Agent
    • FAQ
  • Workflows
    • Introduction
    • Workflow Templates
    • Creating a Workflow
    • User Inputs - Get Started
      • Text Input
      • Long text input
      • Drop-down
      • Numeric Input
      • File to URL
      • File to Text
      • Checkbox
      • Image Input
      • Audio Input
      • Video Input
      • Multiple Media Input
      • Carousel Select Input
    • Actions - Get Started
      • LLM
        • LLM - Advanced Settings
        • Validators
        • Too Much Text
        • LLM Prompt
        • LLM Output
      • Code - JavaScript
      • Code - Python
      • Python Helper Functions
      • PDF to text
      • Extract Website Content
      • Knowledge Search
      • Audio/Video to Text
      • Insert Data into a Dataset
    • Knowledge
    • Workflow Single Run
    • Workflow Table Run
    • Export Results
    • API Run
    • FAQ
    • Parameter Substitution Utility
  • Data
    • Introduction
    • Data Table
    • FAQ
  • Use Cases
    • Summarization
      • GPT on My Files
      • GPT on My Website
      • Question-Answering on Data
    • Research
      • Sentiment Analysis
      • Anonymize Text
      • Audio Transcription + High-Level Analysis
  • Sales
    • Teach LLMs to Mimic Your Style
  • Marketing
    • SEO Optimize
    • Automating Creativity Transforming Workflow with AgenticFlow AI (PDF)
  • Policies
    • Security Overview
      • AI Policy
      • Reporting bugs and vulnerabilities
      • Subprocessors
      • DPA
    • Privacy Policy
    • Terms of Service
    • Cookies Policy
Powered by GitBook
On this page
  • How to Use a Python Action
  • Access the Step Output
  • Common Errors

Was this helpful?

  1. Workflows
  2. Actions - Get Started

Code - Python

A component to run Python

Although AgenticFlow AI is generally a zero or low-code platform, the functionality of adding Python code snippets to your workflows is available and fully supported. Code snippets can be useful in tasks such as pre- or post-processing of data or analysis tasks where LLMs might not be the best fit.

How to Use a Python Action

Adding the Component

To use Python, you need to add a “Code-Python” action to your workflow. Follow these steps to get started:

  1. Navigate to the Workflow page.

  2. Click on + Create Workflow or select an existing workflow.

  3. Click on + Add Action.

  4. Select Code - Python from the list of action components.

Python Packages and Runtime Commands

You can specify all the required Python packages (e.g., pandas) under Packages and all the Runtime Commands (e.g., apt-get install cuda) under Runtime Commands.

Enter your code in the code section as you would in any other IDE (e.g., VS Code, PyCharm).

Access to Input Variables and Other Actions’ Output

Access Input Variables

Input variables can be accessed via params. params is a dictionary, and the names of variables are the dictionary keys. For example, if there is an input parameter named “title,” you can access its value using params["title"].

Access Other Actions’ Output

Outputs from other actions can be accessed via steps. steps is a dictionary, and the names of actions are the dictionary keys. For example, if there is an action named “summary,” you can access its produced value using steps["summary"]["output"].

Access the Step Output

If the name of a Python action is python, you can access the action's output using python.transformed. Note that an action name is different from the action title. Action titles can be found on the top left of actions. An action name is shown on the bottom left, in a smaller font and highlighted green.

Follow the links below for more information about:

Common Errors

The most common errors seen in our logs are Python coding-related errors, for which there are millions of resources available online. However, occasionally, users encounter the Code execution timed out error. Keep in mind that Python snippet execution time cannot exceed 4 hours.

PreviousCode - JavaScriptNextPython Helper Functions

Last updated 11 months ago

Was this helpful?

How to run an action
How to delete an action
How to configure output
How to configure a default value
How to move an action in a Workflow
How to duplicate an action
How to add condition to an action (i.e., execute only if a condition is met)
How to loop an action (i.e., run one step multiple times)