Skip to main content
An action is one thing an agent can do: send a Discord message, fetch a web address, read a pull request. An agent runs an action in two places. A tool runs one when the agent decides to use it. A context step runs one every time, before the agent starts. This page lists every action with its fields. servflowai resource action describe --all prints the same catalog.

All actions

How an action is written in a config file

As a context step, an action is an id, a type, and a config that maps each field to a string. Every string is a template.
As a tool, the same action goes under actionConfig, and each field’s value is wrapped in an object. type: raw means you set the value. type: param means the agent fills it in when it uses the tool, and value names the input it is asked for.
Two differences follow from this:
  • Field types. A step’s values are all strings, so a field of type map cannot be written as a map in a step. A tool’s raw value can be a string, a number, a boolean, a list, or a map.
  • Who fills a field. Only a tool has param.
The examples below show each action as a step. An action with a required map field is shown as a tool. The rest of a step and of a tool is in the CLI reference. In the field tables, Type is the binary’s field type: string, text_area (a long string), boolean, map, file, or integration (the id of a stored integration).

Discord

discord/sendmessage

Sends a message to a Discord channel, a thread, or a person.
As a tool that always posts in one channel and lets the agent write the text:

discord/readmessages

Reads a Discord channel’s recent messages, oldest first.

discord/searchmessages

Searches the whole Discord server for messages that match a phrase, a channel, or an author. Each match comes back with a link to the message.

discord/readguild

Reads the integration’s Discord server: its details, channels, roles, or members.

GitHub

github_fetch

Reads a pull request as a GitHub App: its details, its diff, or its conversation.

github_post

Posts a comment on a GitHub pull request as a GitHub App.

Gitea

gitea/fetch

Reads a pull request from a Gitea server: its details, its diff, or its conversation.

gitea/post

Posts a comment on a Gitea pull request or issue.

Web requests and code

http

Calls a web address and returns the response.
As a tool, with headers and a body. Write body as a map. Each value is filled in on its own and then encoded as JSON, so quotes and line breaks in a value need no escaping.

javascript

Runs JavaScript. The script defines a function named servflowRun, and what the function returns is the action’s result. The function receives three arguments: the run’s variables, the body of the request that started the run, and the request’s parameters. The script cannot call web addresses, and has no require.
A later step or a prompt reads the result as {{ .customer.name }}.

shell

Runs a shell script, with the shell’s full syntax. The script starts in a sandboxed folder of its own that is deleted when the run ends, and it cannot read the server’s own files. The instance’s [shell] settings decide how it is sandboxed.

static

Returns the value you write, after its template is filled in. Use it to build a value once and read it by the step’s id afterwards.

Browser

The four browser actions share one browser session, the chromium integration. Open a page with chromium/navigate first, then read or click it.

chromium/navigate

Opens a web address in the browser.

chromium/click

Clicks an element on the current page.

chromium/body

Returns the HTML of the current page as the browser shows it, after scripts have run.

chromium/screenshot

Takes a full-page screenshot and returns it as a PNG file.

Databases

fetch and delete take filters: a list of conditions, each with a field, an operation, and a comparator. The operations are ==, !=, >, <, >=, <=, and like.

fetch

Reads rows from a table of a SQL or MongoDB database.
As a tool, with a filter the agent fills in:

delete

Deletes the rows of a table that meet the filters.

mongoquery

Runs a query against a MongoDB collection.

firestore

Stores a document in a Google Cloud Firestore collection.

Vectors

storevector

Stores vectors in a vector database, for similarity search.

fetchvectors

Finds the stored vectors closest to the one you give.

Stored values

store_key

Stores a value under a key. The value stays until it is replaced.

get_key

Reads the value stored under a key.

Files and email

download

Saves a file from the request, or from an earlier action’s result, to a folder.

email

Sends an email through an SMTP server.

Sign-in and tokens

authenticate

Checks a JSON Web Token and finds the user it names in a database.

jwt

Creates or checks a JSON Web Token.

hash

Hashes a value, for example a password before it is stored.

Binance

binance/getprice

Reads the current price of a symbol, or its figures for the last 24 hours.

binance/pricedifference

Works out how much a price changed, and by what percentage, over a number of periods.

binance/tradeinfo

Reads trading figures for a pair.

binance/accountbalance

Reads the account’s balances.

binance/spotorder

Places a spot order. This action spends money on a live account. Put a guard on any tool that runs it, and test with the integration’s testnet turned on.

binance/futuresorder

Places a futures order. This action spends money on a live account. Put a guard on any tool that runs it, and test with the integration’s testnet turned on.

ServFlow

servflowvalidate

Checks a ServFlow YAML config for mistakes in its syntax and structure.

agent and parallel

The binary lists two more action types. You do not add them by hand. They are how ServFlow stores parts of an agent.

Tools

How an agent uses an action when it decides to.

Context fetching

How an agent runs an action every time, before it starts.

Available integrations

The integrations these actions take.

Dynamic content reference

The template functions a field can use.