Skip to content

API Trigger Block

The API Trigger block creates an HTTP endpoint using AWS API Gateway. When the endpoint is called, it triggers the connected workflow.

AWS Service: Amazon API Gateway


Configuration Options

Property Default Options Description
path /api-path - The URL path for the API endpoint (e.g., /users, /orders/{id})
method GET GET, POST, PUT, DELETE, PATCH The HTTP method that triggers this endpoint
isSynchronous true true, false Whether the API waits for all blocks to finish before returning a response

Configuration Details

Path

The path property defines the URL path for your API endpoint.

  • Use simple paths like /hello or /users
  • Use path parameters with curly braces: /users/{id}, /orders/{orderId}/items/{itemId}
  • Path parameters are passed to your function in the request payload

Examples:

/api/v1/users
/products/{productId}
/orders/{orderId}/status

Method

The HTTP method determines what type of request triggers the workflow:

Method Typical Use Case
GET Retrieve data
POST Create new resources
PUT Update/replace resources
DELETE Remove resources
PATCH Partial updates

Synchronous vs Asynchronous

Synchronous (isSynchronous: true):

  • API Gateway waits for the entire workflow to complete
  • Returns the output from the first Response block that receives a message
  • Best for: Quick operations, real-time responses

Asynchronous (isSynchronous: false):

  • API Gateway returns immediately with a 200 response
  • Workflow continues processing in the background
  • Best for: Long-running tasks, fire-and-forget operations

AWS Reference


Example Usage

A simple GET endpoint that returns a greeting:

API Trigger (/hello, GET) --> Function --> Response

When deployed, calling GET https://your-api.execute-api.region.amazonaws.com/hello triggers the workflow.