---
title: "Event Driven Machines"
description: "Event Driven Machines presents Lambdo, a pattern for using Fly Machines as short-lived, event-triggered compute rather than relying on HTTP activation. It polls an SQS queue for JSON events, batches the messages and metadata, then creates fast-booting Fly Machines with the events written to /tmp/events.json; the Machine is destroyed after processing finishes. Application code can come from an existing codebase or Lambdo’s Node and PHP runtime images, with handlers or commands processing each event. SQS message attributes select the required image and can specify VM size and command, while the approach supports arbitrary code and even GPU-enabled Machines, giving each event control over its execution environment."
---

# Event Driven Machines

[Fly.io](https://yomu.fyi/company/fly-io) · Feb 5, 2024

**Type:** Problem & solution

## Summary

Event Driven Machines presents Lambdo, a pattern for using Fly Machines as short-lived, event-triggered compute rather than relying on HTTP activation. It polls an SQS queue for JSON events, batches the messages and metadata, then creates fast-booting Fly Machines with the events written to /tmp/events.json; the Machine is destroyed after processing finishes. Application code can come from an existing codebase or Lambdo’s Node and PHP runtime images, with handlers or commands processing each event. SQS message attributes select the required image and can specify VM size and command, while the approach supports arbitrary code and even GPU-enabled Machines, giving each event control over its execution environment.

## Context

The work addresses the need to run code efficiently on fresh, short-lived compute when non-HTTP events arrive. It uses Fly Machines’ fast boot times and serverless-like usage ergonomics to process events without keeping a Machine alive beyond the work.

## Approach / What changed

Lambdo polls an SQS queue, collects JSON message bodies and metadata, creates Fly Machines through the API, writes events to /tmp/events.json, and runs code inside them. The code can use an existing application or Lambdo’s Node and PHP runtimes, with SQS attributes selecting the image, VM size, and command.

## Takeaways

- Lambdo treats each SQS message body as an arbitrary JSON event and passes a batch of events into a newly created Machine.
- Fly Machines receive event data through /tmp/events.json, which application code reads and parses before processing.
- SQS attributes can choose the image, CPU size and type, and command for each event, including configurations using GPU-enabled Machines.

**Tags:** [AWS](https://yomu.fyi/topic/aws), [Fly Machines](https://yomu.fyi/topic/fly-machines), [Serverless](https://yomu.fyi/topic/serverless)

- Source: [Fly.io](https://fly.io/blog/event-driven-machines)
- Source URL: https://fly.io/blog/event-driven-machines
- Ingested by Yomu: 2026-09-02T11:57:02.553Z

[Read original post](https://fly.io/blog/event-driven-machines)
