Bika
GuideAutomation

Run Script

Run Script Action Guide

This automation feature allows users to execute code snippets in specified programming languages. Currently, we support the following three programming languages: JavaScript, TypeScript, and Python.

Detailed Configuration Steps

To use this feature, users need to prepare the script files, which should be written in JavaScript, TypeScript, or Python.

1. Writing the Script

Users can write scripts directly in the BIKA script editor. Please note that the programming language used by the script must be clearly specified: JavaScript, TypeScript, or Python.

2. Configuring the "Run Script" Action

Follow these steps to configure the "Run Script" action in the BIKA automation interface:

Supported Languages and Libraries

  • JavaScript and TypeScript:

    • We provide support for libraries such as fetch, axios, and lodash.

    • JSON data can be returned to the automation workflow.

      • Example code:

        const str = 'Hello, World!';
        const json = { str };
        json;

        JavaScript Example1

    • For asynchronous functions, it is recommended to encapsulate them in an async function and use the return keyword to return data.

      • Example code:

        (async () => {
          const url = 'https://api.exchangerate-api.com/v4/latest/USD';
          const response = await fetch(url);
          if (!response.ok) {
            throw new Error(response.status);
          }
          return await response.json();
        })();

        JavaScript Example2

  • Python:

    • Supported libraries include numpy, httpx, bs4, and pandas.

    • The requests library is not supported.

    • All return variables will be output to the automation workflow.

      • Example code:

        import httpx
        url = 'https://api.exchangerate-api.com/v4/latest/USD'
        r = httpx.get(url)
        data = r.json()

        Python Example

3. Setting Up the Automation Action

  1. Add a new action on the automation task editing page and select "Run Script" from the list of action types.

  2. Choose the script language: JavaScript, TypeScript, or Python.

  3. In the "Script Content" area, enter the script code. For example, you could run a simple Python script to print "Hello World":

    print("Hello World")
  4. Save and Enable: After completing the script setup, click "Save" to save the action.

4. Perform a Test Run

  1. Execute the Test:
  • Return to the automation task interface.
  • Click the "Run Now" button at the bottom of the page, and the system will execute the script according to your configuration.

2。 Check the Results: After the script execution, you can confirm the output by reviewing the run history. If the script runs smoothly and returns the expected results, the configuration is correct.

With this, the configuration and execution of the "Run Script" automation action have been successfully completed.

Recommend AI Automation Templates
Email Reminder
Email Reminder
Automate your team's notifications with Email Reminder. Send recurring emails, automated alerts, and event reminders at scheduled times to ensure timely communication and keep everyone aligned. Perfect for task management, workflow tracking, and improving team productivity with minimal manual effort.
HR Team Project Tracker
HR Team Project Tracker
Streamline HR project management with Bika.ai’s HR workflow template. Our HR automation tools help teams manage staff programs, task assignments, internal requests, and deadlines all in one place. Improve HR task management, reduce manual follow-ups, and keep every project on track with automated reminders and centralized dashboards.
Event contacts management
Event contacts management
Easily manage event contacts, track professional connections, and build your own personal CRM with this event CRM template. Log contact details, meeting notes, follow-up reminders, and attendee information all in one place. Ideal for networking events, conferences, and long-term relationship management. Boost your efficiency with an intuitive contact tracker and event workflow system.
Stock News Reporter
Track U.S. stock news in real time and get structured reports with key insights, market reactions, and sector summaries. Make informed investment decisions fast.
Recruitment Template
Recruitment Template
Streamline your hiring process with this Recruitment Template that centralizes candidate management, tracks candidate status, and stores all applicant information in a comprehensive candidate database. Monitor progress with an intuitive recruitment dashboard, automate daily candidate reminders, and ensure an efficient recruitment workflow from application to hiring. Perfect for recruiters seeking organized, data-driven hiring solutions.

Coming soon

Project tracker
Project tracker
Stay on top of every project with the Project Tracker Template — your all-in-one tool for progress tracking, project monitoring, and task assignment. Gain a clear project overview, update progress in real time, and enhance team coordination with automated workflows and a visual progress dashboard. Improve project efficiency, ensure timely updates, and streamline collaboration across your entire team with this intuitive project management system.