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 step runs one every time its entry fires, before the agent starts. This page lists every built-in action with its fields. servflowai resource action describe --all prints the same catalog. An agent can also run the actions of the apps ServFlow connects to, such as Slack, Gmail, or Jira. The integrations directory lists every app with its actions and events. In the dashboard, those actions appear in the same Search actions box as the built-in ones, grouped by app.

Built-in actions

How an action is written in a config file

As a step, an action is an id, a type, and a config that maps each field to a value of the type the action expects. Every string is a template. A step goes under its entry’s steps, and its id is lowercase letters, digits, and underscores, not starting with a digit.
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 values. A step’s value is written as it is. A tool’s value is wrapped in type and value.
  • Who fills a field. Only a tool has param.
The examples below show each action as a step. A few also show it as a tool, where the agent filling in a field is the point. 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

Reads a MongoDB database. It finds documents in a collection, runs an aggregation pipeline, or lists the collections. It never writes. The operations return the following:
  • find: the matching documents.
  • aggregate: the documents the pipeline outputs. $lookup and $unionWith read other collections, so one pipeline can join data from across the database.
  • listCollections: the database’s collection names, sorted.
The action refuses a filter, projection, or pipeline that contains $out or $merge, which write, or $where, $function, or $accumulator, which run JavaScript on the server. It refuses them at any depth, including inside a $lookup or $facet sub-pipeline, and the error names the refused key. This check applies to this action only. To make the database itself read-only, connect the integration as a MongoDB user that has only the read role. Find one customer by email:
Join each customer to their orders:
To let an agent query the whole database, add mongoquery as an action tool. Set integration yourself, make operation, collection, filterQuery, and pipeline tool parameters, and set failIfEmpty to false so that an empty result reaches the model as an answer, not an error. In the tool description, tell the model to call listCollections first.

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. If nothing is stored under the key, the action fails. When an agent calls get_key as a tool, the agent receives the key not found error and can decide what to do next.

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.

Tools

How an agent uses an action when it decides to.

Entries and entry handlers

How an entry runs an action every time, before the agent starts.

Available integrations

The integrations these actions take.

Dynamic content reference

The template functions a field can use.