AgenticFlow AI: ChatGPT in the Flow of Work
HomeCommunityDiscordLogin
  • Get Started
    • AgenticFlow - Build agents that handle sales, marketing, and creative tasks around the clock.
    • Introduction to Large Language Models
    • Templates
    • AgenticFlow MCP
    • API Keys
    • Workflows quickstart
    • Agents quickstart
    • Plans and Credits
    • System Quotas
    • FAQs
    • Affiliate program đź’µ
  • AGENTS
    • Introduction to agents
    • Agent Templates
    • Create an Agent
    • Customize an Agent
    • Tools and Integrations
  • 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
    • Parameter Substitution Utility
  • Data
    • Introduction
    • Data Table
  • 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
  • Advanced Topics
    • Advanced Topics
Powered by GitBook
On this page
  • How to Use a JavaScript Action
  • Access the Step Output
  • Common Errors

Was this helpful?

  1. Workflows
  2. Actions - Get Started

Code - JavaScript

A component to run JavaScript

Although AgenticFlow AI is generally a zero or low-code platform, the functionality of adding JavaScript 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 JavaScript Action

Adding the Component

To use JavaScript, you need to add a “Code-JavaScript” 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 - JavaScript from the list of action components.

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

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.

Setting the Output of the JavaScript Action

You can set the output of this action to be a string generated by a Large Language Model (LLM) such as GPT. This can be done by clicking on the LLM icon on the top right.

Follow the links below for more information about:

Access the Step Output

If the name of a JavaScript action is javascript, you can access the action's output using javascript.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.

Common Errors

The most common errors seen in our logs are JavaScript 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 JavaScript snippet execution time cannot exceed 15 minutes.

PreviousLLM OutputNextCode - Python

Last updated 9 hours 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)