Skip to main content
This page is for developers and technical operators. You don’t need any of it to build automations in Script.it — the agent writes and maintains scripts for you. It helps when you want to read a generated script, review a change, debug a run, or work on scripts from your own tools.

Command-line interface

Run scripts, read logs, and move files from your terminal or a coding agent.

ChatGPT, Claude, and other AI assistants

Run your scripts and check runs from another AI assistant.

Script file structure

Each script is a folder in a workspace, with a SKILL.md definition, source files, and optional assets.
The agent manages these files for you. You can still read them, export them, or work on them with the CLI.

Script definition

SKILL.md is the script’s definition. It follows the Agent Skills format: YAML frontmatter, then a Markdown body. Each fenced yaml block in the body declares one block. Prose between the fences is the script’s documentation in the app.
Blocks run in the order they appear.

Frontmatter fields

Legacy scripts may still contain flow.script.yaml. Importing one converts it to SKILL.md.

Block fields

Don’t write type, outputs, or integrations in a fence. Script.it reads them from the block’s source.

Writing a block in Python

A block is a Python file with a function decorated with @block(). Its typed Inputs class is what people see and edit on the block’s card. Returning a dict succeeds, and each key becomes an output later blocks can read. Raising an exception fails the block.
  • Inputs. title is the field’s label and description its help text. json_schema_extra={"ui_hint": {...}} picks a widget, such as dropdown, slider, checkbox, file-reference, folder-picker, or date-picker. Defaults belong on the Inputs fields.
  • Outputs. An optional Outputs class declares the files the block writes, so the app can show them.
  • Integrations. ctx.http(url, "<integration>", ...) calls an API through a connected integration and takes the usual requests arguments. Your code never handles credentials.
  • Logging. ctx.log(message) adds a line to the block’s timeline. ctx.log_artifact(path, name=...) names a file on it.
  • Folders. The working directory is the block’s output folder (ctx.data_dir). ctx.script_data_dir is the script’s assets/.

Python packages

Common packages come pre-installed, including pandas, numpy, httpx, openpyxl, python-docx, pypdf, beautifulsoup4, jinja2, and pyyaml. For anything else, add a line to the workspace’s requirements.txt. Script.it installs it for everyone who uses the workspace, including triggered runs.

Expressions

Use ${{ ... }} in a block’s source_file, output_directory, inputs, and env, and in script input defaults. A value that is only an expression keeps its type, so ${{ inputs.replicas }} stays a number. An expression inside a longer string makes a string.

Functions

link(path) returns the app link that opens a script on its page, or a file or folder in the file view, beside the session. Use it when a script sends someone a link to something it made, instead of building app URLs by hand:
link() takes two options: layout — "split" (the default, beside the session) or "full" — and session — "current" (the default) or "new". To write a literal ${{ text }}, escape it as $${{ text }}.

What people see of a block’s results

  • Summary. A file named output.md or output.html in a block’s output folder is shown as that block’s summary on its card.
  • HTML. .html files render in a sandboxed frame with JavaScript on. Browser storage and cookies aren’t available inside it.
  • JSON. .json files open in an editor that can show tables, record pages, and boards.

Agents and permission files

A script can run an Agent: an AI agent with its own instructions, model, time limit, and permission, invoked from a Python block. An Agent is defined in an .agent.md file, usually in the script’s assets/:
The Markdown body is the Agent’s system prompt. The file name, without .agent.md, is its name. See Agents. A permission file (*.permission.yaml) holds a permission in its own file, so several Agents can share one. The same format defines the permission profiles you pick for a session in the composer. The app shows a permission file as a form, with a toggle to see the YAML. See Permission profiles.

Runtime files

Script files and session files are separate:
  • Script files live in the script’s folder and are shared with everyone who can see the workspace.
  • Script assets live in assets/ and persist across sessions.
  • Session files live in the session’s data_files/: block outputs (each in its block’s output_directory), attachments, and trigger payloads.
  • Run records and logs belong to the session that ran them.
Each session has its own folder, so concurrent sessions never read or overwrite each other’s run files. See Session files.

Agent context fields

The script header’s Agent Context setting maps to the frontmatter: See Agent context for user-facing guidance.

Trigger payloads

When a trigger runs a script, Script.it runs it in a session and passes the event data into that session.
  • Webhook triggers receive the HTTP request body.
  • App event triggers receive event data from the connected tool.
  • Schedule triggers receive schedule metadata such as the scheduled time.
A script that needs the trigger data reads it from the session’s files at ${{ session.data_files }}/trigger_event.json.

Schedules and cron

Schedule triggers can use presets or a custom five-field cron expression:
Cron expressions use the timezone configured on the trigger.

Integrations and credentials

Integrations use OAuth, API keys, or custom headers depending on the service. Script.it stores integration credentials encrypted and never writes them into script source files or chat history. Blocks call integrations through ctx.http, so code never sees the credentials. Custom integrations use a two-layer model:
  • The integration type defines the API shape: base URL, auth mode, OAuth URLs, docs URL, logo, and schema.
  • The connection stores one user’s credentials for that type.
Connections and custom integration types can be shared with workspaces. Sharing a connection lets others use the owner’s account. Sharing a custom type shares the API definition, so each member connects their own credentials.

Versioning

Scripts in a workspace are version-controlled. Script.it saves a version at the end of every agent turn that changed a script. To go back, click the history button beside Run in the script header, pick a version, click Restore version, and confirm with Restore this version. Restoring brings back SKILL.md and the script’s source files as they were in that version, and removes source files added since. Assets, logs, and run outputs stay as they are. The restore is saved as a new version, so nothing in the history is lost. You can also ask the agent to undo a change. See Outlines, comments, and history.