Skip to content

Function Block

The Function block executes code in response to events. It deploys as an AWS Lambda function and contains the business logic of your workflow.

AWS Service: AWS Lambda


Configuration Options

General Settings

Property Default Options Description
language TypeScript TypeScript Programming language for the function code
skipDeploy false true, false When checked, the function will not be included in deployment
deployAsDockerImage false true, false Deploy the function as a Docker container image instead of a zip file

Only Typescript is available now. More languages coming soon.

Lambda Settings

Property Default Range Description
lambdaRuntime nodejs22.x nodejs20.x, nodejs22.x Node.js runtime version
lambdaMemory 128 128 - 10,240 MB Memory allocated to the function
lambdaTimeout 60 1 - 900 seconds Maximum execution time
lambdaEphemeralStorage 512 512 - 10,240 MB Size of the /tmp directory
lambdaArchitecture x86_64 x86_64, arm64 CPU architecture
lambdaReservedConcurrentExecutions - 0+ Maximum concurrent executions
lambdaProvisionedConcurrency 0 0+ Pre-warmed instances
lambdaBatchSize - 1+ Number of records per batch (for queue triggers)
lambdaMaximumBatchingWindow 0 0 - 300 seconds Time to wait for batch to fill (for queue triggers)

Configuration Details

Memory

Lambda allocates CPU power proportionally to memory. More memory = more CPU.

Memory Use Case
128 MB Simple operations, minimal processing
512 MB Standard API handlers, light processing
1024 MB Data processing, moderate compute
3008+ MB CPU-intensive tasks, large data sets

Performance Tip

Start with 128 MB and increase if you see slow execution times.

Timeout

The maximum time your function can run before being terminated.

Timeout Use Case
3-10 seconds API responses, quick operations
30-60 seconds Data processing, external API calls
300+ seconds Batch processing, complex operations
900 seconds (max) Long-running tasks

Important

For synchronous API triggers, keep timeouts under 29 seconds (API Gateway limit).

Architecture

Architecture Pros Cons
x86_64 Broader compatibility Higher cost
arm64 (Graviton2) 20% better price-performance Some libraries may not support

Ephemeral Storage

The /tmp directory size for temporary files during execution.

  • Default: 512 MB
  • Maximum: 10,240 MB (10 GB)
  • Use for: Temporary file processing, caching, large file operations

Concurrency Settings

Reserved Concurrent Executions: Limits the maximum number of simultaneous function instances.

  • Set to prevent function from consuming all available account concurrency
  • Useful for rate-limiting or protecting downstream resources

Provisioned Concurrency: Pre-warms function instances to eliminate cold starts.

  • Instances are always ready to respond
  • Incurs additional cost
  • Best for: Latency-sensitive applications

Skip Deploy

When enabled, the function will not be included in the deployment. This is useful for:

  • Local testing: Create a local HTTP server to test if callbacks are being called correctly
  • Development workflows: Keep test functions in your workflow without deploying them
  • Debugging: Temporarily exclude functions from deployment while troubleshooting

Use Case

You can create a local HTTP server function to test callback behavior without needing to deploy it to AWS.

Deploy as Docker Image

By default, function code is deployed as a zip file sent to the cloud. However, some use cases require a pre-configured environment that can only be set up with a Docker image.

When to use Docker deployment:

  • Functions that require system-level dependencies (browsers, native libraries)
  • Custom runtime configurations
  • Large dependencies that exceed Lambda zip size limits
  • Specific OS-level packages or configurations

Considerations

  • Docker builds take significantly longer than zip deployments
  • Requires Docker to be installed and running on your machine

Customizing the Docker Build

To customize the Docker build, edit the Dockerfile.hbs file in your block's folder. Orixen provides the {{baseImage}} and {{{buildSteps}}} template variables that you must include.

Example: A Dockerfile.hbs for a block that needs Chromium installed:

FROM {{baseImage}}

# Install Chromium dependencies
RUN dnf install -y \
    atk \
    cups-libs \
    gtk3 \
    libXcomposite \
    libXdamage \
    libXrandr \
    libgbm \
    pango \
    alsa-lib \
    nss \
    xdg-utils \
    && dnf clean all

{{{buildSteps}}}
Template Variable Description
{{baseImage}} The AWS Lambda base image for your runtime
{{{buildSteps}}} Required build steps injected by Orixen (copying code, installing dependencies, etc.)

AWS Reference


Coding the Function


Best Practices

  1. Start small: Begin with 128 MB memory and increase based on performance
  2. Set appropriate timeouts: Don't use max timeout unnecessarily
  3. Use arm64: When possible, for better price-performance
  4. Monitor cold starts: Use provisioned concurrency for latency-sensitive workloads
  5. Handle errors: Implement proper error handling and logging