From efbc7e13f754e5cd2cceb8dbc5ca67e3b1779e22 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 18 Aug 2026 13:05:21 +0000 Subject: [PATCH] AVO-2568: document how the import API decides "Include in Codegen" The import now defaults a newly attached source to "Include in Codegen" whenever the plan allows codegen and the source is codegen-configured, matching what the UI does when you attach a source by hand. The docs said nothing about the setting, and the sources table left readers to guess what happened to the `implementWithCodegen` field the Avo export writes. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01GkHYCAX9UD9sB9YFjBJmtp --- pages/reference/public-api/import-tracking-plan.mdx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pages/reference/public-api/import-tracking-plan.mdx b/pages/reference/public-api/import-tracking-plan.mdx index f9f67dbf..b07e1a02 100644 --- a/pages/reference/public-api/import-tracking-plan.mdx +++ b/pages/reference/public-api/import-tracking-plan.mdx @@ -174,7 +174,7 @@ The format produced by Avo's [JSON Schema export](/reference/public-api/export-t | `description` | string | Event description | | | `eventType` | string | — | Events with type `"variant"` are skipped with a warning | | `tags` | `string[]` | Event tags | | -| `sources` | `{ name: string }[]` | Source names | Only the `name` field is extracted | +| `sources` | `{ name: string }[]` | Source names | Only the `name` field is extracted. `implementWithCodegen` is ignored — see [Include in Codegen](#include-in-codegen) for how the setting is decided | | `stakeholderDomains` | `{ name: string, isOwner: bool }[]` | Domain names + owner | The domain with `isOwner: true` becomes the event owner | | `categories` | `string[]` | **Not imported** | Export contains goal IDs, not names — left empty to avoid phantom categories | | `rules.nameMapping` | `{ name, destinationId }[]` | Event name mapping | | @@ -241,6 +241,17 @@ The following will cause a parse error: - Unresolved `$ref` — only inline schemas are supported +## Include in Codegen + +The import does not read `implementWithCodegen` from the payload. Instead, when the import attaches a source to an event, it decides "Include in Codegen" the same way the Avo UI does when you attach a source by hand: + +- **On**, if your plan includes codegen **and** the source is configured for codegen — it has a programming language, a platform, and at least one destination. +- **Off**, otherwise. A source the import itself creates is always off, because a brand-new source has no language or platform yet. + +This applies only when a source is **newly attached** to an event. Re-importing an event whose source is already attached leaves the existing setting untouched, so a toggle you changed in the UI is never overwritten by a later import. + +To change "Include in Codegen" on an event that is already attached to a source, use the Avo MCP server's `save_items` tool (`setSourceCodegen`) or the Avo UI. + ## Import Methods ### Add Only (default)