Aywa RuntimeDocumentation
Website Create account

Migration

Switch execution, keep the assistant contract familiar.

The migration workflow is for compatible assistant configurations from third-party voice platforms. The goal is to move execution into private infrastructure while keeping provider mapping, tools, and validation steps explicit.

Positioning boundary

Aywa Runtime is independently developed. Third-party product names are used only to identify supported import sources, compatibility fields, or customer migration context.

Independent runtime: compatibility imports help teams migrate assistant configurations they already own. Aywa Runtime is independently developed and is not affiliated with, endorsed by, or sponsored by third-party voice platforms.

Migration flow

Export

Export assistant, phone number, tool, server, and credential references from the current platform.

Import

Use the runtime importer to preserve compatible fields and map source ids to runtime ids.

Map

Attach provider credentials, webhook credentials, BYO SIP trunks, and storage settings in the private runtime.

Validate

Run staging calls, compare tool calls, inspect timelines, then cut traffic gradually.

Importer endpoints

The runtime exposes import routes for compatibility workflows. Source ids can be mapped to runtime ids for later lookup and phased cutovers.

POST/importsImport compatible assistant configurations with a neutral sourceFormat or compatibilityProfile.
Import request
{
  "sourceFormat": "compatible_assistant_export",
  "compatibilityProfile": "generic_assistant_v1",
  "sourcePlatform": "vapi",
  "apiKey": "source_private_key",
  "dryRun": true,
  "mode": "upsert",
  "resourceTypes": ["assistants", "tools", "phoneNumbers", "credentials"]
}

What changes in your application code

The importer migrates compatible runtime resources; it does not rewrite or deploy your application. Your backend must point to the private runtime, use runtime IDs, and verify Aywa webhook signatures. The generated Application migration kit in the runtime dashboard contains an environment template, ID map, SQL, call example, webhook verifier, and cutover checklist for the completed import.

No hidden cutover: imported configuration and application migration are separate steps. Keep the source path available until calls, tools, webhooks, artifacts, and telephony pass staging.
Server packageReplace @vapi-ai/server-sdk with @aywa-ai/runtime-sdk.
Client setupReplace the hosted API token with an explicit runtime baseUrl, server API key, and runtime organization ID.
Resource IDsReplace source assistant, phone-number, tool, file, and structured-output IDs using the generated id-map.json or SQL pack.
Phone callsUse calls.createPhone and provide a stable idempotency key for each business operation.
Web callsUse the runtime WebRTC session flow. Never expose a private runtime API key in browser or mobile code.
WebhooksThe stable { "message": ... } envelope remains familiar; verify x-aywa-signature against the raw request body.
ToolsCommon tool-calls payload and result shapes remain compatible where possible; validate provider-specific fields and every business-critical tool.

Before and after: outbound phone call

The business payload remains familiar. The material changes are the client, private runtime endpoint, organization scope, mapped IDs, and explicit idempotency.

Before: hosted source SDK
import { VapiClient } from "@vapi-ai/server-sdk";

const vapi = new VapiClient({
  token: process.env.VAPI_API_KEY,
});

await vapi.calls.create({
  assistantId: process.env.VAPI_ASSISTANT_ID,
  phoneNumberId: process.env.VAPI_PHONE_NUMBER_ID,
  customer: { number: "+33611111111" },
});
After: private Aywa Runtime
import { AywaRuntimeClient } from "@aywa-ai/runtime-sdk";

const runtime = new AywaRuntimeClient({
  baseUrl: process.env.AYWA_RUNTIME_BASE_URL,
  apiKey: process.env.AYWA_RUNTIME_API_KEY,
  organizationId: process.env.AYWA_RUNTIME_ORGANIZATION_ID,
});

await runtime.calls.createPhone({
  assistantId: process.env.AYWA_RUNTIME_ASSISTANT_ID,
  phoneNumberId: process.env.AYWA_RUNTIME_PHONE_NUMBER_ID,
  customer: { number: "+33611111111" },
}, {
  idempotencyKey: "outbound-call-customer-123-attempt-1",
});

Reuse the same idempotency key when retrying the same business operation. Generate a new key only for a genuinely new call request.

Webhook cutover

Aywa Runtime sends the stable { "message": ... } body used by compatible server-event integrations. The trust boundary changes: verify the raw request body with the runtime-owned signing secret before parsing or executing a tool.

Signature verification
import { verifyAywaWebhookSignature } from "@aywa-ai/runtime-sdk";

const verified = await verifyAywaWebhookSignature({
  secret: process.env.AYWA_RUNTIME_WEBHOOK_SECRET,
  rawBody,
  signature: request.headers["x-aywa-signature"],
  toleranceSeconds: 300,
});

if (!verified) throw new Error("Invalid Aywa Runtime webhook signature");

const { message } = JSON.parse(rawBody);

Keep

Your event switch for compatible message types such as status-update, tool-calls, and end-of-call-report.

Change

Signature header, signing secret, source IDs, runtime endpoint, and any provider-specific assumptions.

Prove

Tool results, retries, replay, transcripts, recordings, cost fields, transfers, and end reasons in staging.

Browser and mobile integrations

A source browser SDK is not replaced by the server SDK. Create the web call from a trusted backend, obtain the runtime WebRTC session, then give only the short-lived session material to the browser. Private runtime API keys remain server-side.

Required rewrite: browser event names and media/session setup are an integration boundary. Validate microphone permissions, reconnect, barge-in, hangup, and final call reporting before removing the previous browser path.

ID mapping and customer SQL patches

The migration assistant is available inside the private runtime dashboard under Migration. It imports compatible resources, builds a source-id to runtime-id mapping table, and can generate a reviewable SQL pack for the customer-owned tables that still store source ids.

Safe by design: Aywa Runtime generates SQL, row-count previews, and an explicit transaction. It does not connect to or mutate the customer's application database automatically. Review the file in staging, back up production, then apply it through your normal database release process.

Mapping table

Creates or updates aywa_import_id_mappings with organization, source provider, resource type, source id, runtime id, action, and source name.

Reference inputs

For each customer table, provide table name, column name, resource type, optional filter column, optional filter value, and text or uuid casting.

Patch output

Generates SELECT count(*) previews plus UPDATE ... FROM statements that replace source ids with runtime ids through the mapping table.

Runtime dashboard request shape
{
  "organizationId": "org_...",
  "sourcePlatform": "vapi",
  "mode": "upsert",
  "sqlMappingTable": "public.aywa_import_id_mappings",
  "sqlReferenceUpdates": [
    {
      "tableName": "public.calls",
      "columnName": "assistant_id",
      "resourceType": "assistants",
      "filterColumn": "workspace_id",
      "filterValue": "customer_workspace_123",
      "valueCast": "text"
    },
    {
      "tableName": "public.tool_runs",
      "columnName": "tool_id",
      "resourceType": "tools",
      "valueCast": "uuid"
    }
  ]
}

The copied fullMigration SQL contains the mapping-table schema, mapping upserts, reference previews, reference updates, and BEGIN/COMMIT boundaries. Third-party names in this workflow identify the migration source only; the resulting resources run on Aywa Runtime.

Validation checklist

Assistant

System prompt, first message, model settings, voice settings, transcriber settings, metadata.

Tools

Function names, parameters, timeouts, server URL, credentials, headers, and response handling.

Webhooks

Assistant, phone number, tool, and account fallback server targets.

Telephony

BYO SIP trunk, phone number binding, inbound route, outbound caller id, DTMF, transfer behavior.

Artifacts

Transcript, recording, structured output, end-of-call report, and cost breakdown.

Latency

Endpointing, first model token, first TTS audio, barge-in timing, and tool roundtrip.

Compatibility boundary

Aywa Runtime can import compatible assistant configurations from existing customer-owned exports. The import profile identifies the format being mapped; it does not imply affiliation, endorsement, or shared ownership with any third-party platform.

Mapped

Assistant instructions, model settings, voice settings, tools, webhook targets, phone number bindings, and source id references.

Re-attached

Provider credentials, SIP trunks, storage destinations, billing ownership, and production deployment settings.

Validated

Turn handling, tool calls, endpointing, barge-in behavior, webhook retries, and call artifacts before traffic cutover.

What is not automatic: application deployment, secret transfer, DNS or SIP routing, browser SDK replacement, database execution, traffic switching, and rollback remain customer-controlled.