Skip to content

Your first script

A script is a reusable piece of code that flows execute. This tutorial walks you through creating one, running it, and deploying it.

Prerequisites: The Orvanta CLI installed and a workspace connected. See Installation.

  1. Create a script

    Terminal window
    orvanta script new f/demo/greet python

    This scaffolds a script at the path f/demo/greet. Edit the generated file so its main function takes a name:

    def main(name: str):
    return f"Hello, {name}!"

    The input schema is derived from main’s parameters — Orvanta uses it to validate inputs and to build an auto-generated UI.

  2. Run it with sample input

    Terminal window
    orvanta script run f/demo/greet --data '{"name": "Ada"}'

    You should see Hello, Ada! in the output.

  3. Preview without deploying

    Terminal window
    orvanta script preview f/demo/greet --data '{"name": "Ada"}'
  4. Deploy to the workspace

    Terminal window
    orvanta sync push

    The script is now available to any flow in the workspace.