Migrating AI Colleagues
Coming Soon — Guided AOP MigrationWe are actively building a guided flow to copy AOPs across environments. This flow will automatically handle pre-requisites like Tools, Workflow Apps, and Integration connections — significantly reducing the manual effort described in this guide. Stay tuned for updates.
Overview
Leena AI supports a multi-environment setup — Staging, UAT, and Production — so your team can build and test AI Colleague configurations safely before rolling them out to employees. Each environment runs as a separate bot instance within a shared bot cluster.
This guide walks you through the step-by-step process of promoting your AI Colleague setup from one environment to the next (e.g., Staging → UAT → Production). It covers the correct order of operations and the actions required for each component.
What Needs to Move
An AI Colleague setup consists of several interconnected components. Each component has its own migration path:
| Component | Migration Method | Notes |
|---|---|---|
| Integrations / Connectors | Manual setup | Credentials and endpoints often differ across environments. Must be configured first. |
| Workflow Applications | Automated (via Workflows Studio) | Use the built-in App Migration feature. See documentation → |
| Tools | Varies by tool type | Main blocker — requires careful handling based on tool category. See detailed guidance below. |
| AI Colleagues (AICs) | Manual recreation | Create and configure each AIC in the target environment. |
| AOPs | Manual recreation | Rebuild or copy AOP instructions in the target environment. |
Recommended Migration Order
Follow this sequence to avoid dependency issues:
Integrations → Workflow Apps → Tools → AI Colleagues → AOPs
Each step depends on the one before it. For example, Tools reference Workflow Apps and Integrations, so those must exist in the target environment first. Similarly, AOPs reference Tools, so Tools must be set up before AOPs.
Step 1: Set Up Integrations and Connectors
Why this comes first: Tools, Workflow Apps, and AOPs rely on integration connections (e.g., Workday, ServiceNow, Jira, SFTP) to execute actions. These connections must be live and authenticated in the target environment before anything that depends on them can work.
What to do:
- Go to Integrations in the target environment's dashboard.
- For each integration your AI Colleague uses in the source environment, create a new connection in the target environment.
- Enter the target environment's credentials — these will typically differ from your source environment (different API keys, OAuth apps, service accounts, endpoints, etc.).
- Authenticate and verify each connection is active.
Important: Make a note of which integrations you've set up and their connection names. You'll need to map these during Workflow App migration and when recreating Tools.
Step 2: Migrate Workflow Applications
Why this comes second: Many Tools are backed by Workflow Apps. The Workflow App must exist in the target environment before you can create or link the corresponding Tool.
What to do:
Leena AI provides an automated migration flow for Workflow Applications. The detailed process is documented here:
App Migrate & Clone Options →
In summary:
- In Workflows Studio, locate the application you want to migrate.
- Select Migrate from the app's options menu.
- Select the target bot — only bots within the same cluster are available. Details →
- Review warnings — the system flags any hardcoded values or potential issues. Details →
- Map configurations — the system extracts all environment-specific dependencies (Audiences, Users, Connections, Master Tables, DoA Datasets) and asks you to map each one to its equivalent in the target environment. Details →
- Complete migration — the system creates a new Draft version of the app in the target environment with all references remapped. Details →
- Review and publish — open the migrated app in the target environment, verify the configuration, and publish it.
You can track all migrations via Migration History. Details →
Tip: If you want to copy an app within the same environment (e.g., to create a variant), use the Clone option instead. Details →
Step 3: Recreate Tools
Tools are the main blocker during migration because the actions required depend on the type of tool. There is no one-click migration for all tool types — each category needs to be handled differently.
Understanding Tool Types
| Tool Type | Category | What It Does |
|---|---|---|
| Workflow Tools | WORKFLOWS | Triggers a Workflow Application (conversational form, webview, or list view) |
| API Tools | API | Makes custom HTTP calls (GET/POST) to external services |
| MCP Tools | MCP | Connects to external tools via Model Context Protocol through the Integrations layer |
| Employee Directory | Built-in | Searches employee data — auto-provisioned per bot |
| Other Built-in Tools | Built-in | System capabilities (web search, data analysis, etc.) — auto-provisioned |
Workflow Tools
Effort: Low — These are auto-created when you link them.
Once the Workflow App has been migrated (Step 2), you can create the corresponding Workflow Tool in the target environment:
- Go to AIC Studio → Tools in the target environment.
- Click Add Tool → select Workflows as the category.
- The dropdown will show all migrated and published Workflow Apps available in this environment. Select the relevant app.
- The system automatically determines the best interaction mode (conversational, form agent, or webview) based on the form complexity.
- Configure the tool name, description, slug, and execution scope.
- If the workflow is asynchronous (long-running, involves approvals), enable Wait for callback.
- Save and enable the tool.
Key check: Make sure the Workflow App is published (not just in Draft) before creating the tool. Draft apps won't appear in the workflows list.
API Tools
Effort: Medium to High — These must be recreated manually.
API Tools make direct HTTP calls to external endpoints. Since URLs, authentication headers, and API keys typically differ between environments, these cannot be automatically migrated.
What to do:
- In the source environment, open each API Tool and note down its configuration:
- HTTP method (GET / POST)
- Endpoint URL
- Headers (including auth tokens)
- Query parameters
- Path parameters
- Request body schema
- Which parameters are static ("const") vs. dynamic ("input" — filled by the AI)
- In the target environment, create a new API Tool with the equivalent configuration:
- Update the endpoint URL to the target environment's API endpoint
- Update authentication credentials (API keys, tokens, service account headers)
- Keep the JSON schema structure the same unless the target API differs
- Use the Test API Tool feature to validate the configuration before enabling it.
- Match the tool name, slug, and description so that AOPs referencing it by name will work correctly.
Common pitfalls:
- Forgetting to update hardcoded environment-specific URLs
- Using source environment API keys/tokens that don't work in the target
- Mismatching the tool slug — AOPs reference tools by identifier, so keep slugs consistent
MCP Tools
Effort: Medium — Requires re-linking to target environment connections.
MCP Tools connect to external tools (e.g., Jira, Salesforce, ServiceNow) through the Integrations layer. The application and connection IDs are environment-specific, so these tools must be recreated.
What to do:
- Ensure the required integration application is authenticated in the target environment (this should be done in Step 1).
- In the target environment, go to AIC Studio → Tools → Add Tool.
- Select MCP as the category.
- Browse the available integration applications and select the correct one.
- Choose the authenticated connection.
- Select the specific tools/actions you want to expose (or import all).
- Save — the system will automatically sync the tool definitions from the MCP server.
- Match the tool name and slug to what was used in the source environment.
Note: If the MCP server exposes OAuth-based tools (tools that require end-user login), verify that the OAuth flow works correctly in the target environment.
Built-in Tools (Employee Directory, Web Search, etc.)
Effort: None — These are automatically provisioned.
Built-in tools like Employee Directory, Web Search, Data Analysis, and Loop Executor are system-managed and automatically available in every bot environment. No migration action is needed.
However, if you've customized the configuration of the Employee Directory tool (e.g., which fields to use for semantic search, profile key mappings), verify these settings in the target environment and reconfigure if needed.
Step 4: Create AI Colleagues
AI Colleagues themselves need to be manually created in the target environment.
What to do:
- In the source environment, note down each AI Colleague's configuration:
- Name and description
- Avatar and persona settings
- Enabled/disabled status
- Any custom orchestrator-level settings
- In the target environment, go to AIC Studio and create each AI Colleague with the same configuration.
- Ensure the AIC is in Active status once configured.
Tip: If you have multiple AICs (e.g., "HR Assistant", "IT Helper", "Finance Bot"), create all of them before moving to AOPs, since AOPs are assigned to specific AICs.
Step 5: Rebuild AOPs
AOPs (Agent Operating Procedures) are the instructions that tell an AI Colleague how to behave, which tools to use, and how to handle specific scenarios. These must be rebuilt manually in the target environment.
What to do:
- In the source environment, open each AOP and copy or note down:
- AOP name and identifier
- AOP type (Primary / Helper)
- Instruction text (the core prompt)
- Referenced Tools (by name or identifier)
- Referenced AOPs (if the AOP calls other AOPs)
- Audience restrictions (if any)
- Schedule configuration (if applicable)
- In the target environment, create each AOP under the correct AI Colleague:
- Paste the instruction text
- Re-link the Tools — make sure the tool names/identifiers match what you created in Step 3
- Re-link any AOP cross-references
- Configure audiences (these are environment-specific — set them up fresh in the target)
- Set up schedules if needed
- Publish the AOP to make it active.
Important considerations:
- Audiences are environment-specific. Even if the audience names are the same, they have different internal IDs across environments. Always select audiences from the target environment's audience list.
- Tool references in AOP instructions use the tool's name or identifier. If you kept the same slugs and names in Step 3, the references will resolve correctly.
- Test each AOP using the Workbench in the target environment before making it available to users.
Post-Migration Checklist
After completing all steps, validate your setup in the target environment:
- Integrations: All connections are authenticated and active
- Workflow Apps: Migrated apps are published (not in Draft)
- Workflow Tools: Linked to the correct migrated Workflow Apps
- API Tools: Endpoints, credentials, and schemas are correct for the target environment
- MCP Tools: Connected to the right integration applications and connections; tools are synced
- AI Colleagues: All AICs are created and active
- AOPs: All AOPs are published, referencing the correct tools and audiences
- End-to-end test: Run representative queries through the Workbench to verify tools execute correctly
- Audience verification: Confirm that audience-scoped AOPs and Tools resolve to the correct user groups in the target environment
Frequently Asked Questions
Can I automate the entire migration?
Currently, Workflow App migration is automated. For other components (Tools, AICs, AOPs), manual recreation is required because configuration values (credentials, audiences, connection IDs) are environment-specific.
What if I forget to migrate a Workflow App before creating its Tool?
The Workflow App won't appear in the Tools dropdown. Migrate and publish the Workflow App first, then create the tool.
Do I need to recreate Built-in Tools?
No. Built-in Tools (Employee Directory, Web Search, Data Analysis, etc.) are automatically available in every environment.
What happens to in-flight workflows during migration?
Migration creates a new Draft version in the target environment. It does not affect running workflows in either the source or target environment.
Can I migrate between environments that are not in the same cluster?
No. Workflow App migration is restricted to bots within the same cluster. For cross-cluster setups, all components must be manually recreated.
