Topolo Docs Topolo Platform
Open workspace

Regenerate AI draft

Generate a proposed draft again from its stored inputs and the current Brand voice, optionally guided by reviewer feedback. The output, findings and provenance are replaced and attempt increases. Only proposed drafts can be regenerated; nothing is applied.

Outcome

Generate a proposed draft again from its stored inputs and the current Brand voice, optionally guided by reviewer feedback. The output, findings and provenance are replaced and attempt increases. Only proposed drafts can be regenerated; nothing is applied.

Before you start

  • Verify identity and pin the intended organization and environment before discovering the action.
  • Discover a granted Nurture workspace. The application permission is workspace:write; required workspace access is read_write. A permission alone does not supply a workspace grant.
  • Organization and workspace come from verified context. Select resourceType/resourceId separately from action input; body fields cannot grant a different organization or workspace. The first authorized product action can initialize an identity-only workspace mirror.
  • Obtain authorization for the documented effect or personal-data export before supplying CLI --confirm or MCP confirm:true.

Discover the target

topolo whoami --json
topolo actions get app_topolo_nurture.drafts.regenerate --detail --json
topolo resources topolo-nurture --json
topolo workspaces list topolo-nurture --json
topolo actions get app_topolo_nurture.drafts.list --detail --json
  • id: drafts record id in the selected workspace.

Request

POST /api/drafts/{id}/regenerate

Save action input as payload.json. The reviewed plan separates path identifiers, query fields and HTTP body. Set NURTURE_WORKSPACE_ID from granted resource discovery; it is separate from action input.

Inspect and test this action in the signed action console. A test response still requires the verification below.

Input fields

FieldRequiredTypeConstraints
idRequiredstringdrafts record id in the selected workspace. {"minLength":1,"maxLength":64}
feedbackOptionalstring{"minLength":1,"maxLength":1000}

Exact input schema:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64
    },
    "feedback": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1000
    }
  },
  "required": [
    "id"
  ],
  "additionalProperties": false
}

Effects

  • Runs one billed Nexus completion and replaces the draft's output, findings and provenance.

Interpret the response

The returned identifier path is $.draft.id for draft. Empty lists do not discover a target.

Call app_topolo_nurture.drafts.get and confirm attempt increased.

Exact success schema:

{
  "type": "object",
  "required": [
    "draft"
  ],
  "properties": {
    "draft": {
      "type": "object",
      "required": [
        "id",
        "kind",
        "status",
        "findings",
        "approvable",
        "provenance"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "enum": [
            "template_copy",
            "subject_lines",
            "journey"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "proposed",
            "approved",
            "rejected"
          ]
        },
        "inputs": {
          "type": "object"
        },
        "output": {},
        "findings": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "code",
              "severity",
              "path",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "severity": {
                "type": "string",
                "enum": [
                  "error",
                  "flag"
                ]
              },
              "path": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          }
        },
        "approvable": {
          "type": "boolean"
        },
        "provenance": {
          "type": "object",
          "required": [
            "route",
            "provider",
            "model",
            "brandKitId",
            "brandVoiceVersion",
            "claimsVersion",
            "promptInputsHash",
            "actingUserId",
            "generatedAt"
          ],
          "properties": {
            "route": {
              "type": "string"
            },
            "provider": {
              "type": "string"
            },
            "model": {
              "type": "string"
            },
            "requestId": {
              "type": [
                "string",
                "null"
              ]
            },
            "brandKitId": {
              "type": "string"
            },
            "brandVoiceVersion": {
              "type": "string"
            },
            "claimsVersion": {
              "type": "string"
            },
            "promptInputsHash": {
              "type": "string"
            },
            "actingUserId": {
              "type": "string"
            },
            "generatedAt": {
              "type": "string"
            }
          }
        },
        "attempt": {
          "type": "integer"
        },
        "createdBy": {
          "type": "string"
        },
        "createdAt": {
          "type": "string"
        },
        "updatedAt": {
          "type": "string"
        },
        "decidedBy": {
          "type": [
            "string",
            "null"
          ]
        },
        "decidedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "decisionNote": {
          "type": [
            "string",
            "null"
          ]
        },
        "applied": {
          "type": [
            "object",
            "null"
          ]
        }
      }
    }
  }
}

Worked examples

Actual dispatcher and migration-created SQLite or Worker handlers; identity/workspace and external service dependencies are simulated. Fixture identifiers and timestamps are synthetic. These responses establish no live authorization, paid generation, credential provisioning or message delivery. Replace synthetic identifiers using credential-scoped discovery. A local success is not evidence of a deployed effect, configured provider or delivered message.

Successful request

Actual dispatcher and migration-created SQLite; verified identity/workspace and external CRM, Engage, Notify, Consent, Nexus, Brand, Generator, Voice and delivery dependencies are simulated. No live authorization, paid generation or external delivery is established.

Input · payload.json:

{
  "id": "dft_fa8ce1226f784f2bb0be44794fbc1e5c",
  "feedback": "Shorter"
}

CLI:

topolo actions validate app_topolo_nurture.drafts.regenerate --data @payload.json --json
topolo actions plan app_topolo_nurture.drafts.regenerate --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_nurture.drafts.regenerate --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --confirm --json

MCP tool and arguments:

{
  "tool": "topolo_call_action",
  "arguments": {
    "actionId": "app_topolo_nurture.drafts.regenerate",
    "input": {
      "id": "dft_fa8ce1226f784f2bb0be44794fbc1e5c",
      "feedback": "Shorter"
    },
    "resourceType": "workspace",
    "resourceId": "<identifier returned by resource discovery>",
    "confirm": true
  }
}

Captured local response · HTTP 200:

{
  "draft": {
    "id": "dft_fa8ce1226f784f2bb0be44794fbc1e5c",
    "kind": "template_copy",
    "status": "proposed",
    "inputs": {
      "goal": "Welcome new trial users",
      "audience": "Developers who just signed up"
    },
    "output": {
      "content": {
        "subject": "Welcome aboard",
        "preheader": "Start here",
        "blocks": [
          {
            "id": "h",
            "kind": "heading",
            "level": 1,
            "text": "Hello"
          },
          {
            "id": "body",
            "kind": "text",
            "text": "Second take."
          },
          {
            "id": "footer",
            "kind": "footer"
          }
        ]
      },
      "claimIds": []
    },
    "findings": [],
    "approvable": true,
    "provenance": {
      "route": "app_topolo_nexus.ai.completions.create",
      "provider": "anthropic",
      "model": "test-model",
      "requestId": "req_1",
      "brandKitId": "bk_1",
      "brandVoiceVersion": "bkv_3",
      "claimsVersion": "bkv_3:e249a86d78e6c46b",
      "promptInputsHash": "04c944a62ca55a0cd544f7a6f9641f3a63db3666363840cd8b3cfa3fc656bf00",
      "actingUserId": "u1",
      "generatedAt": "2026-10-04T00:32:34.869Z"
    },
    "attempt": 2,
    "createdBy": "u1",
    "createdAt": "2026-10-04T00:32:34.857Z",
    "updatedAt": "2026-10-04T00:32:34.869Z",
    "decidedBy": null,
    "decidedAt": null,
    "decisionNote": null,
    "applied": null
  }
}

HTTP 200. Call app_topolo_nurture.drafts.get and confirm attempt increased.

Another supported request

Actual dispatcher and migration-created SQLite; verified identity/workspace and external CRM, Engage, Notify, Consent, Nexus, Brand, Generator, Voice and delivery dependencies are simulated. No live authorization, paid generation or external delivery is established.

Input · payload.json:

{
  "id": "dft_fa8ce1226f784f2bb0be44794fbc1e5c"
}

CLI:

topolo actions validate app_topolo_nurture.drafts.regenerate --data @payload.json --json
topolo actions plan app_topolo_nurture.drafts.regenerate --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_nurture.drafts.regenerate --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --confirm --json

MCP tool and arguments:

{
  "tool": "topolo_call_action",
  "arguments": {
    "actionId": "app_topolo_nurture.drafts.regenerate",
    "input": {
      "id": "dft_fa8ce1226f784f2bb0be44794fbc1e5c"
    },
    "resourceType": "workspace",
    "resourceId": "<identifier returned by resource discovery>",
    "confirm": true
  }
}

Captured local response · HTTP 200:

{
  "draft": {
    "id": "dft_fa8ce1226f784f2bb0be44794fbc1e5c",
    "kind": "template_copy",
    "status": "proposed",
    "inputs": {
      "goal": "Welcome new trial users",
      "audience": "Developers who just signed up"
    },
    "output": null,
    "findings": [
      {
        "code": "invalid_schema",
        "severity": "error",
        "path": "$",
        "message": "Invalid input: expected object, received undefined"
      }
    ],
    "approvable": false,
    "provenance": {
      "route": "app_topolo_nexus.ai.completions.create",
      "provider": "anthropic",
      "model": "test-model",
      "requestId": "req_1",
      "brandKitId": "bk_1",
      "brandVoiceVersion": "bkv_3",
      "claimsVersion": "bkv_3:e249a86d78e6c46b",
      "promptInputsHash": "3b638660aea82d9590afd02882b169abb6e07e81d60cb4e2749e11449896c843",
      "actingUserId": "u1",
      "generatedAt": "2026-10-04T00:32:34.871Z"
    },
    "attempt": 3,
    "createdBy": "u1",
    "createdAt": "2026-10-04T00:32:34.857Z",
    "updatedAt": "2026-10-04T00:32:34.871Z",
    "decidedBy": null,
    "decidedAt": null,
    "decisionNote": null,
    "applied": null
  }
}

HTTP 200. Call app_topolo_nurture.drafts.get and confirm attempt increased.

Refused request · draft_decided

Actual dispatcher and migration-created SQLite; verified identity/workspace and external CRM, Engage, Notify, Consent, Nexus, Brand, Generator, Voice and delivery dependencies are simulated. No live authorization, paid generation or external delivery is established.

Input · payload.json:

{
  "id": "dft_d3dd0e0640924b809281aebc4a3fb6dc"
}

CLI:

topolo actions validate app_topolo_nurture.drafts.regenerate --data @payload.json --json
topolo actions plan app_topolo_nurture.drafts.regenerate --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json

Captured local response · HTTP 409:

{
  "error": {
    "code": "draft_decided",
    "message": "This draft was already approved."
  }
}

HTTP 409. Preserve the refusal details and do not claim success.

Refused request · generation_failed

Actual dispatcher and migration-created SQLite; verified identity/workspace and external CRM, Engage, Notify, Consent, Nexus, Brand, Generator, Voice and delivery dependencies are simulated. No live authorization, paid generation or external delivery is established.

Input · payload.json:

{
  "id": "dft_fa8ce1226f784f2bb0be44794fbc1e5c"
}

CLI:

topolo actions validate app_topolo_nurture.drafts.regenerate --data @payload.json --json
topolo actions plan app_topolo_nurture.drafts.regenerate --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json

Captured local response · HTTP 502:

{
  "error": {
    "code": "generation_failed",
    "message": "The drafting model call failed; retry later.",
    "details": {
      "status": 503,
      "code": "provider_circuit_open"
    }
  }
}

HTTP 502. Preserve the refusal details and do not claim success.

Refused request · not_found

Actual dispatcher and migration-created SQLite; verified identity/workspace and external CRM, Engage, Notify, Consent, Nexus, Brand, Generator, Voice and delivery dependencies are simulated. No live authorization, paid generation or external delivery is established.

Input · payload.json:

{
  "id": "dft_none"
}

CLI:

topolo actions validate app_topolo_nurture.drafts.regenerate --data @payload.json --json
topolo actions plan app_topolo_nurture.drafts.regenerate --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json

Captured local response · HTTP 404:

{
  "error": {
    "code": "not_found",
    "message": "Draft was not found in this workspace."
  }
}

HTTP 404. Preserve the refusal details and do not claim success.

Verify the result

  • Call app_topolo_nurture.drafts.get and confirm attempt increased.

Errors and recovery

  • organization_required (HTTP 403): Select an organization available to the verified caller before choosing a Nurture workspace.
  • permission_denied (HTTP 403): Grant the credential the required Nurture workspace permission.
  • workspace_required (HTTP 409): Create a Nurture workspace, or pass the workspace resource context.
  • invalid_input (HTTP 422): Correct the fields named in error.details using inputSchema, then retry.
  • drafting_unavailable (HTTP 503): AI drafting is not configured on this deployment; write the copy manually.
  • brand_voice_required (HTTP 409): Bind a published TopoloBrand kit with a voice to the workspace, then retry.
  • generation_failed (HTTP 502): The Nexus completion failed (details carry its status and code); retry later.
  • not_found (HTTP 404): List drafts to find a valid id in this workspace.
  • draft_decided (HTTP 409): The draft was already approved or rejected; create a new one with app_topolo_nurture.drafts.create.

Auth or gateway failures may precede this handler. Preserve the exact response shape, error string/code, request id and credential context; no synthetic fixture establishes live credential access.

Recovery boundary

Reject the proposed draft; nothing was applied.

  • Approve AI draft: Approve a proposed draft as the calling person (recorded in decidedBy). Refused when a finding is an error, when flags exist without acknowledgeFlags true, or (with requireSecondApprover) when the caller requested it. Copy for a template becomes a NEW non-current version (make it current by saving it with app_topolo_nurture.templates.update); other copy becomes a new template; subject_lines applies candidate subjectIndex; a journey becomes a DRAFT journey with new templates. Nothing is published or sent.
  • Reject AI draft: Reject a proposed draft as the calling person, with an optional note. Nothing is applied; the draft is kept for audit.

Evidence

Actual dispatcher and migration-created SQLite or Worker handlers; identity/workspace and external service dependencies are simulated. Fixture identifiers and timestamps are synthetic. These responses establish no live authorization, paid generation, credential provisioning or message delivery. Test scenario and capture digests are retained with each fixture.