Skip to content

Connector Reference

Connectors define the actions a step can perform. Actions use a connector/action naming convention. For AI tool use (function calling), see Tool Use.

http/request

Makes an HTTP request.

Params:

ParamTypeRequiredDescription
methodstringYesHTTP method: GET, POST, PUT, PATCH, DELETE.
urlstringYesRequest URL.
headersmapNoHTTP headers as key-value pairs.
bodyanyNoRequest body. Objects are JSON-encoded.

Output:

FieldTypeDescription
statusnumberHTTP response status code.
headersmapResponse headers.
bodystringRaw response body as a string.
jsonanyParsed response body. Only present when the response is valid JSON.

Example:

- name: create-item
  action: http/request
  params:
    method: POST
    url: https://api.example.com/items
    headers:
      Authorization: "Bearer {{ env.API_TOKEN }}"
      Content-Type: application/json
    body:
      name: "New Item"
      quantity: 5

ai/completion

Sends a prompt to an OpenAI-compatible chat completion API and returns the result. Requires a credential with an API key — see the Secrets Guide for setup.

Params:

ParamTypeRequiredDescription
providerstringNoAI provider to use: openai (default) or bedrock.
modelstringYesModel name (e.g., gpt-4o, gpt-4o-mini, anthropic.claude-3-sonnet-20240229-v1:0).
promptstringYesThe user prompt to send.
regionstringNoAWS region for the Bedrock provider (e.g., us-east-1). Only used when provider is bedrock.
system_promptstringNoSystem message prepended to the conversation.
output_schemaobjectNoJSON Schema for structured output. When set, the model returns JSON conforming to this schema.
base_urlstringNoOverride the API base URL. Defaults to https://api.openai.com/v1. Use this for OpenAI-compatible providers like Azure, Ollama, or local models.
toolslistNoTool declarations for function calling. See Tool Use.
max_tool_roundsintegerNoMaximum number of LLM-tool interaction rounds. Default: 10 (from engine.default_max_tool_rounds).
max_tool_calls_per_roundintegerNoMaximum number of tool calls the LLM can make in a single round. Default: 10 (from engine.default_max_tool_calls_per_round).

Output:

FieldTypeDescription
textstringThe raw completion text returned by the model.
jsonanyIf the response is valid JSON (e.g., from structured output), the parsed object. Only present when the response parses as JSON.
tool_callslistTool invocations requested by the model. Each item has id, type, and function (with name and arguments). Only present when the model requests tool calls in the final response.
finish_reasonstringWhy the model stopped generating. stop for normal text completion, tool_calls when the model requested tool invocations.
modelstringThe model name as reported by the API.
usage.prompt_tokensnumberNumber of tokens in the prompt.
usage.completion_tokensnumberNumber of tokens in the completion.
usage.total_tokensnumberTotal tokens used.

Example — basic completion:

- name: summarize
  action: ai/completion
  credential: my-openai
  params:
    model: gpt-4o
    prompt: "Summarize this in 3 bullet points: {{ steps.fetch-data.output.body }}"

Example — with system prompt and structured output:

- name: extract-entities
  action: ai/completion
  credential: my-openai
  timeout: 60s
  params:
    model: gpt-4o
    system_prompt: "You are a data extraction assistant. Always respond with valid JSON."
    prompt: "Extract all person names and companies from: {{ steps.fetch-data.output.body }}"
    output_schema:
      type: object
      properties:
        people:
          type: array
          items:
            type: string
        companies:
          type: array
          items:
            type: string
      required:
        - people
        - companies
      additionalProperties: false

The structured output is available as steps.extract-entities.output.json.people and steps.extract-entities.output.json.companies in subsequent steps.

Example — custom base URL (Ollama):

- name: local-completion
  action: ai/completion
  params:
    model: llama3
    base_url: http://localhost:11434/v1
    prompt: "Explain this error: {{ steps.fetch-logs.output.body }}"

Example — AWS Bedrock:

- name: summarize
  action: ai/completion
  credential: aws-bedrock-creds
  params:
    provider: bedrock
    model: anthropic.claude-3-sonnet-20240229-v1:0
    region: us-east-1
    prompt: "Summarize: {{ steps.fetch.output.body }}"

When running on AWS infrastructure with an IAM role attached (IRSA, instance profile, etc.), the credential field can be omitted — the Bedrock provider uses the standard AWS credential chain automatically.

Authentication: The AI connector reads the credential’s api_key field (or token or key as fallbacks) and sends it as a Bearer token. If the credential includes an org_id field, it is sent as the OpenAI-Organization header. See the Secrets Guide for how to create an openai-type credential.

slack/send

Sends a message to a Slack channel via the chat.postMessage API. Requires a credential with a Slack Bot User OAuth Token.

Params:

ParamTypeRequiredDescription
channelstringYesSlack channel ID (e.g., C01234ABCDE). Use the channel ID, not the channel name.
textstringYesMessage text. Supports Slack mrkdwn formatting.

Output:

FieldTypeDescription
okbooleantrue if the message was sent successfully.
tsstringSlack message timestamp. Use this to reference the message in follow-up API calls.
channelstringThe channel ID where the message was posted.

Example:

- name: notify-team
  action: slack/send
  credential: slack-bot
  params:
    channel: "C01234ABCDE"
    text: "Deployment complete: {{ steps.deploy.output.body }}"

Authentication: The Slack connector reads the credential’s token field and sends it as a Bearer token. Create a credential of type bearer with a token field containing your Slack Bot User OAuth Token:

mantle secrets create --name slack-bot --type bearer --field token=xoxb-your-bot-token

slack/history

Reads recent messages from a Slack channel via the conversations.history API.

Params:

ParamTypeRequiredDescription
channelstringYesSlack channel ID (e.g., C01234ABCDE).
limitnumberNoMaximum number of messages to return. Default: 10.

Output:

FieldTypeDescription
okbooleantrue if the request was successful.
messageslistArray of message objects. Each message contains fields like text, user, ts, and type.

Example:

- name: read-channel
  action: slack/history
  credential: slack-bot
  params:
    channel: "C01234ABCDE"
    limit: 5

- name: summarize-messages
  action: ai/completion
  credential: my-openai
  params:
    model: gpt-4o
    prompt: "Summarize these Slack messages: {{ steps['read-channel'].output.messages }}"

postgres/query

Executes a parameterized SQL query against an external Postgres database. The connector opens a connection per step execution and closes it afterward. Supports both read queries (SELECT, WITH) and write statements (INSERT, UPDATE, DELETE).

Params:

ParamTypeRequiredDescription
querystringYesSQL query to execute. Use $1, $2, etc. for parameterized values.
argslistNoOrdered list of values to substitute into the parameterized query.

Output (SELECT/WITH queries):

FieldTypeDescription
rowslistArray of row objects, each mapping column names to values. Empty array if no rows match.
row_countnumberNumber of rows returned.

Output (INSERT/UPDATE/DELETE statements):

FieldTypeDescription
rows_affectednumberNumber of rows affected by the statement.

Example — read query:

- name: fetch-users
  action: postgres/query
  credential: my-database
  params:
    query: "SELECT id, email FROM users WHERE active = $1 LIMIT $2"
    args:
      - true
      - 100

Example — write statement:

- name: update-status
  action: postgres/query
  credential: my-database
  params:
    query: "UPDATE orders SET status = $1 WHERE id = $2"
    args:
      - "shipped"
      - "{{ steps['create-order'].output.json.order_id }}"

Authentication: The Postgres connector reads the database connection URL from the credential’s url field (or key as a fallback). Create a credential with the full Postgres connection string:

mantle secrets create --name my-database --type generic --field url=postgres://user:pass@host:5432/dbname?sslmode=require

email/send

Sends an email via SMTP. Supports plaintext and HTML content.

Params:

ParamTypeRequiredDescription
tostring or listYesRecipient email address(es). A single string or a list of strings.
fromstringYesSender email address.
subjectstringYesEmail subject line.
bodystringYesEmail body content.
htmlbooleanNoSet to true to send the body as HTML. Default: false (plaintext).
smtp_hoststringNoSMTP server hostname. Can also be provided via credential.
smtp_portstringNoSMTP server port. Default: 587. Can also be provided via credential.

Output:

FieldTypeDescription
sentbooleantrue if the email was sent successfully.
tostringComma-separated list of recipient addresses.
subjectstringThe subject line that was sent.

Example:

- name: send-report
  action: email/send
  credential: smtp-creds
  params:
    to:
      - "alice@example.com"
      - "bob@example.com"
    from: "reports@example.com"
    subject: "Daily Report — {{ steps.generate.output.json.date }}"
    body: "{{ steps.generate.output.json.html_report }}"
    html: true

Authentication: The email connector reads username, password, host, and port from the credential. If host or port are not in the credential, they fall back to the smtp_host and smtp_port params. Create a basic credential with SMTP fields:

mantle secrets create --name smtp-creds --type basic \
  --field username=apikey \
  --field password=SG.your-sendgrid-key \
  --field host=smtp.sendgrid.net \
  --field port=587

s3/put

Uploads an object to an S3-compatible storage bucket.

Params:

ParamTypeRequiredDescription
bucketstringYesS3 bucket name.
keystringYesObject key (path) within the bucket.
contentstringYesObject content as a string.
content_typestringNoMIME type for the object. Default: application/octet-stream.

Output:

FieldTypeDescription
bucketstringThe bucket the object was uploaded to.
keystringThe object key.
sizenumberSize of the uploaded content in bytes.

Example:

- name: upload-report
  action: s3/put
  credential: aws-s3
  params:
    bucket: "my-reports"
    key: "reports/{{ steps.generate.output.json.date }}.json"
    content: "{{ steps.generate.output.json.report }}"
    content_type: "application/json"

s3/get

Downloads an object from an S3-compatible storage bucket.

Params:

ParamTypeRequiredDescription
bucketstringYesS3 bucket name.
keystringYesObject key (path) within the bucket.

Output:

FieldTypeDescription
bucketstringThe bucket the object was downloaded from.
keystringThe object key.
contentstringObject content as a string.
sizenumberSize of the downloaded content in bytes.
content_typestringMIME type of the object as reported by S3.

Example:

- name: download-config
  action: s3/get
  credential: aws-s3
  params:
    bucket: "my-configs"
    key: "app/config.json"

s3/list

Lists objects in an S3-compatible storage bucket, with optional prefix filtering.

Params:

ParamTypeRequiredDescription
bucketstringYesS3 bucket name.
prefixstringNoFilter results to keys that start with this prefix.

Output:

FieldTypeDescription
bucketstringThe bucket that was listed.
objectslistArray of objects. Each object has key (string), size (number), and last_modified (string, RFC 3339).

Example:

- name: list-reports
  action: s3/list
  credential: aws-s3
  params:
    bucket: "my-reports"
    prefix: "reports/2026/"

S3 Authentication

All S3 connectors (s3/put, s3/get, s3/list) read the following fields from the credential:

FieldRequiredDescription
access_keyYesAWS access key ID.
secret_keyYesAWS secret access key.
regionNoAWS region. Default: us-east-1.
endpointNoCustom S3 endpoint URL. Use this for S3-compatible services like MinIO, DigitalOcean Spaces, or Backblaze B2.

Create a credential for S3:

mantle secrets create --name aws-s3 --type generic \
  --field access_key=AKIA... \
  --field secret_key=wJalr... \
  --field region=us-west-2

For S3-compatible services, add an endpoint field:

mantle secrets create --name minio --type generic \
  --field access_key=minioadmin \
  --field secret_key=minioadmin \
  --field endpoint=http://localhost:9000