> For the complete documentation index, see [llms.txt](/llms.txt).
> A full single-fetch corpus is available at [llms-full.txt](/llms-full.txt).
---
title: Serverless SDK reference
description: Define serverless components, durable steps, suspension, and events with the Python, TypeScript, and Go SDKs.
last_verified: 2026-07-24
---

The serverless SDK adapters expose AGNT5 components through `workerless.v1`. They generate the manifest, verify signed invoke requests, replay checkpoints, and return durable completion or suspension responses.

## Choose an adapter

| Language | Entrypoint | Host interface |
| --- | --- | --- |
| Python | `agnt5.serverless` | ASGI and FastAPI mounting |
| TypeScript | `@agnt5/sdk/serverless` | Fetch-native `Request` and `Response` |
| Go | `github.com/agnt5dev/sdk-go/serverless` | `net/http.Handler` |

Python, TypeScript, and Go implement the durable HTTP contract. Go exposes transport-neutral tool and agent runners so serverless code does not depend on a persistent worker connection.

## Configure the handler

Every adapter accepts a service name, immutable service version, signing-secret resolver, and registered components. Resolve the secret from provider configuration; do not embed it in source.

| Field | Purpose |
| --- | --- |
| Service name | Identifies the endpoint in its manifest. |
| Service version | Identifies immutable provider code. |
| Signing secret | Verifies AGNT5 invoke requests with HMAC-SHA256. |
| Enabled resolver | Fails closed during an endpoint-side incident. |

## Use durable steps

A **durable step** records JSON output in the response checkpoint. A reinvocation with the same step key returns the checkpointed output instead of executing the function again.

Keep step names stable and keep step results serializable. Renaming a step can repeat an external side effect.

```python
profile = await ctx.step("load-profile", load_profile)
```

```typescript
const profile = await ctx.step('load-profile', loadProfile);
```

```go
profile, err := serverless.Step(ctx, "load-profile", func(context.Context) (Profile, error) {
    return loadProfile()
})
```

## Suspend before timeout

The AGNT5 invoke request contains a deadline and yield margin. Call the language's yield method before starting more work. When the budget is exhausted, the adapter returns `status=suspended` with its checkpoint and AGNT5 reinvokes the same pinned deployment.

| Language | Budget method | Timer method |
| --- | --- | --- |
| Python | `await ctx.yield_if_needed()` | `await ctx.sleep(seconds, name=...)` |
| TypeScript | `await ctx.yieldIfNeeded()` | `await ctx.sleep(milliseconds, name)` |
| Go | `ctx.YieldIfNeeded()` | `ctx.Sleep(duration, name)` |

## Emit durable events

Python `ctx.emit()`, TypeScript `ctx.emit()`, and Go `ctx.Emit()` return events in the invoke response. AGNT5 appends them to the run journal; clients stream from AGNT5 rather than directly from the provider endpoint.

## Compare beta capabilities

| Capability | Python / TypeScript | Go |
| --- | --- | --- |
| Typed workflows | Supported | Supported |
| Checkpointed steps | Supported | Supported |
| Budget and timer suspension | Supported | Supported |
| Emitted events | Supported | Supported |
| Large payload references | Supported | Supported |
| Signal and user-input suspension | Supported | Supported |
| Functions, tools, and agents | Supported where registered | Supported |

## Next steps

- [Serverless protocol reference](/docs/run/serverless-protocol.md): inspect the generated wire contract.
- [Build a serverless endpoint in Go](/docs/integrations/go-serverless.md): run the Go adapter end to end.
- [Add AGNT5 to FastAPI](/docs/integrations/fastapi-serverless.md): mount the Python adapter.
- [Add AGNT5 to a Node.js server](/docs/integrations/node-serverless.md): mount the Node adapter.
