---
title: "Convert AWS Lambda source"
method: POST
path: "/api/v1/functions/import/lambda"
tags: ["Functions"]
---

# Convert AWS Lambda source

`POST /api/v1/functions/import/lambda`

Convert AWS Lambda handler code to a Raff function. Stateless —
nothing is stored; review the output, then create a function and
deploy the returned files.

Two modes:

- `rewrite` (default) — AI rewrites the handler to a portable
  standard handler (FastAPI / Web Fetch / net/http). Every guess is
  flagged in `warnings`. 5 free per calendar month, then $0.30 per
  conversion from your balance. Up to 64KB of source.
- `adapter` — your code ships unchanged plus a small static shim that
  presents API-Gateway-style events. Instant, free, unlimited.

Config always maps deterministically: memory/timeout, env vars to
`raff_toml`, EventBridge `rate()` schedules to cron trigger
proposals. IAM, VPC, layers and stream sources are listed in
`out_of_scope` with alternatives.

## Request body

- ConvertLambdaRequest
  - `lambda_runtime` string, required — AWS runtime id, e.g. `python3.12`, `nodejs20.x`, `go1.x`
  - `files` FunctionSourceFile[], required
    - `name` string, required
    - `content` string, required
  - `handler` string — Lambda handler, e.g. `lambda_function.handler`
  - `memory_mb` integer
  - `timeout_seconds` integer
  - `env_vars` object
  - `trigger_config_json` string — Optional EventBridge/S3/FunctionURL config to map
  - `mode` 'rewrite' | 'adapter' — `rewrite` = AI portable-handler rewrite; `adapter` = run unchanged via a static shim (free)

## Response `200`

Conversion result (review before deploying)

- object
  - `success` boolean
  - `data` ConvertLambdaResult
    - `runtime` 'python' | 'node' | 'go'
    - `converted_files` FunctionSourceFile[]
      - `name` string, required
      - `content` string, required
    - `raff_toml` string — Mapped configuration (review before deploying)
    - `proposed_triggers` string[] — Ready-made trigger payloads mapped from EventBridge schedules
    - `warnings` string[] — Every guess or behavior difference — review before deploying
    - `out_of_scope` string[] — Items that are not migrated, with alternatives
    - `free_remaining_month` integer
    - `conversion_price` number
    - `charged` boolean

## Other responses

- `400` — Invalid request parameters
- `401` — Authentication required
- `403` — AI rewrite requires a funded account (adapter mode works without)

---

[API](https://skmtc.dev/rafftechnologies/apis/raff-api.md) · [All operations](https://skmtc.dev/rafftechnologies/apis/raff-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/rafftechnologies/raff-api/revisions/2f4df56be77c/schema)
