Tasks

Tasks are the building blocks of a flow. Each task performs a specific operation — subscribing to a message stream, transforming data, querying a database, or writing results. All tasks receive events and emit events to the next task in the flow.

Task categories

Flowgen has two categories of tasks: subscribers and processors.

Subscribers

Subscribers are source tasks that ingest data into the flow. They connect to external systems and produce events.

TaskDescription
nats_jetstream_subscriberConsumes messages from a NATS JetStream stream with durable consumers.
salesforce_pubsubapi_subscriberSubscribes to Salesforce Platform Events via gRPC.
http_webhookListens for incoming HTTP requests and converts them to events.
generateProduces events on a schedule (cron or interval).

Subscribers appear as the first task in a flow. They manage acknowledgment — a message is only acked when the entire downstream flow completes successfully.

Processors

Processors receive events, do something with them, and emit events to the next task.

TaskDescription
scriptExecutes Rhai scripts for transformation, filtering, and routing.
convertConverts between data formats (JSON, Arrow, Avro).
iterateFans out array data into individual events.
bufferAccumulates events into batches before forwarding.
logLogs event data for debugging.
http_requestMakes outbound HTTP calls.
nats_jetstream_publisherPublishes events to a NATS JetStream subject.
nats_kv_storeRead, write, list, and delete keys in a NATS KV bucket.
salesforce_pubsubapi_publisherPublishes Salesforce Platform Events.
salesforce_restapi_sobjectSalesforce CRUD operations (create, get, update, upsert, delete).
salesforce_restapi_compositeBatch Salesforce operations.
salesforce_bulkapi_query_jobSalesforce Bulk API query jobs.
salesforce_toolingapiSalesforce metadata management.
gcp_bigquery_queryBigQuery SQL queries.
gcp_bigquery_storage_readBigQuery Storage Read API.
gcp_bigquery_storage_writeBigQuery Storage Write API.
gcp_bigquery_jobBigQuery async jobs (load, monitor, cancel).
mssql_queryMicrosoft SQL Server queries.
object_storeObject storage operations (read, write, list, move) on S3, GCS, Azure, local.
git_syncClone/pull a Git repository and emit one event per file.
ai_completionLLM completions from multiple providers.
ai_gatewayOpenAI-compatible chat completions endpoint.
mcp_toolExpose flows as MCP tools for LLM agents.

Task wiring

By default, tasks are wired sequentially — each task receives from the previous task and sends to the next. Linear chains, fan-out, fan-in, and end-to-end acknowledgement semantics are covered in Flows.

Common configuration

All tasks share these optional fields:

- script:
    name: my_transform        # required: unique within the flow
    depends_on: [source]       # optional: receive from named tasks instead of previous
    retry:                     # optional: overrides app-level retry
      max_attempts: 5
      initial_backoff: "2s"
    code: |
      event.data

Event data formats

Tasks can produce and consume three event data formats:

  • JSON — Default for REST APIs, webhooks, and script output.
  • Arrow RecordBatch — Columnar data (BigQuery, Parquet). Zero-copy through the flow.
  • Avro — Binary format for gRPC and Pub/Sub (Salesforce Platform Events).

The convert task translates between formats when needed.