mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-07-05 06:59:23 +00:00
* feat: adopt directory-based docs versioning with Edge channel Switch docs.crewai.com from navigation-only versioning (every version selector entry rendered the same docs/<lang>/* source files) to Mintlify's directory-based versioning so each version selector entry renders its own snapshot. Add an "Edge" channel under docs/edge/<lang>/* that always reflects main HEAD for unreleased work, eliminating pre-release leakage onto frozen release labels. External links to canonical /<lang>/* URLs are preserved via wildcard redirects that always land on the current default version. Layout: - docs/edge/<lang>/* rolling source (you edit here) - docs/edge/enterprise-api.*.yaml - docs/v<X.Y.Z>/<lang>/* frozen, immutable snapshots - docs/v<X.Y.Z>/enterprise-api.*.yaml - docs/images/ shared, append-only - docs/docs.json nav + redirects URLs follow the Mintlify-idiomatic shape: /edge/<lang>/<page> for Edge, /v<X.Y.Z>/<lang>/<page> for every frozen snapshot. The wildcard redirects /<lang>/:slug* -> /<default>/<lang>/:slug* keep stale links working, and every freeze rewrites them (plus all per-section/per-page redirects) so destinations always resolve to the current default without depending on a second redirect hop. Release flow integration (devtools release): - New module crewai_devtools.docs_versioning.freeze() materialises docs/v<X.Y.Z>/ from docs/edge/, rewrites openapi: refs inside the snapshot, inserts the version into every language block in docs.json, and refreshes all redirect destinations. - _update_docs_and_create_pr() in cli.py now calls that freeze during Phase 2 of devtools release. Edge changelogs are updated first (so the snapshot freeze picks them up), then the snapshot is staged alongside docs.json, branched as docs/freeze-v<X.Y.Z>, and the PR is titled [docs-freeze] docs: snapshot and changelog for v<X.Y.Z> — the title prefix the new CI guard reads. - The PR still gates tag, GitHub release, PyPI publish, and the enterprise release as before; no new PRs are added. - Pre-releases (1.X.YaN, 1.X.YbN, ...) skip the snapshot — they ride Edge — and the docs PR title omits the [docs-freeze] prefix. - docs_check (AI-generated docs scaffolding) writes to docs/edge/<lang>/* so newly-generated unreleased docs land in Edge and never accidentally touch a frozen snapshot. Migration scripts (one-shot): - scripts/docs/freeze_historical_versions.py reconstructs all 16 historical snapshots (v1.10.0 .. v1.14.7) from git tags via git archive | tar, rewriting openapi: MDX refs so each snapshot reads its own enterprise-api YAML rather than the live one. - scripts/docs/prefix_version_paths.py one-shot-migrates docs.json: rewrites every page path in 16 versioned blocks to point under docs/v<X.Y.Z>/, inserts a new Edge entry per language, tags v1.14.7 as Latest (default), prunes pages whose target file doesn't exist in the snapshot (e.g. docs/ar/ didn't exist before v1.12.0), and writes the wildcard + per-section redirects. - scripts/docs/freeze_current_edge.py is now a thin CLI wrapper around docs_versioning.freeze for manual one-off freezes (e.g. retroactively snapshotting a forgotten release). CI guards (.github/workflows/docs-snapshots.yml): - Frozen snapshots under docs/v[0-9]*/ are immutable; only PRs whose title contains [docs-freeze] (i.e. release-cut PRs generated by devtools release or the manual wrapper) may modify them. - Images under docs/images/ are append-only since snapshots share a single image directory. Deleting or renaming an image breaks every historical snapshot that still references it. Restored docs/images/crewai-otel-export.png from PR #3673; it was deleted in PR #4908 but v1.10.0 / v1.10.1 snapshots still reference it. Restoring instead of editing the snapshots preserves historical rendering fidelity and validates the new append-only rule retroactively. Tests: - lib/devtools/tests/test_docs_versioning.py covers the freeze: file copy, openapi rewrite, version insertion, default demotion, redirect upserts, per-section redirect rewriting, idempotency, and invalid inputs. Verified locally with mintlify broken-links: 0 broken links across the full site (Edge + 16 frozen versions, 4 locales). AGENTS.md (repo root) is the contributor guide for the new model; RELEASING.md is the release-cut runbook; README's Contribution section links to both. Co-authored-by: Cursor <cursoragent@cursor.com> * style: resolve linter issues --------- Co-authored-by: Cursor <cursoragent@cursor.com>
452 lines
13 KiB
Plaintext
452 lines
13 KiB
Plaintext
---
|
|
title: "Deploy to AMP"
|
|
description: "Deploy your Crew or Flow to CrewAI AMP"
|
|
icon: "rocket"
|
|
mode: "wide"
|
|
---
|
|
|
|
<Note>
|
|
After creating a Crew or Flow locally (or through Crew Studio), the next step is
|
|
deploying it to the CrewAI AMP platform. This guide covers multiple deployment
|
|
methods to help you choose the best approach for your workflow.
|
|
</Note>
|
|
|
|
## Prerequisites
|
|
|
|
<CardGroup cols={2}>
|
|
<Card title="Project Ready for Deployment" icon="check-circle">
|
|
You should have a working Crew or Flow that runs successfully locally.
|
|
Follow our [preparation guide](/en/enterprise/guides/prepare-for-deployment) to verify your project structure.
|
|
</Card>
|
|
<Card title="GitHub Repository" icon="github">
|
|
Your code should be in a GitHub repository (for GitHub integration
|
|
method)
|
|
</Card>
|
|
</CardGroup>
|
|
|
|
<Info>
|
|
**Crews vs Flows**: Both project types can be deployed as "automations" on CrewAI AMP.
|
|
The deployment process is the same, but they have different project structures.
|
|
See [Prepare for Deployment](/en/enterprise/guides/prepare-for-deployment) for details.
|
|
</Info>
|
|
|
|
## Option 1: Deploy Using CrewAI CLI
|
|
|
|
The CLI provides the fastest way to deploy locally developed Crews or Flows to the AMP platform.
|
|
The CLI automatically detects your project type from `pyproject.toml` and builds accordingly.
|
|
|
|
<Steps>
|
|
<Step title="Install CrewAI CLI">
|
|
If you haven't already, install the CrewAI CLI:
|
|
|
|
```bash
|
|
pip install crewai[tools]
|
|
```
|
|
|
|
<Tip>
|
|
The CLI comes with the main CrewAI package, but the `[tools]` extra ensures you have all deployment dependencies.
|
|
</Tip>
|
|
|
|
</Step>
|
|
|
|
<Step title="Authenticate with the Enterprise Platform">
|
|
First, you need to authenticate your CLI with the CrewAI AMP platform:
|
|
|
|
```bash
|
|
# If you already have a CrewAI AMP account, or want to create one:
|
|
crewai login
|
|
```
|
|
|
|
When you run either command, the CLI will:
|
|
1. Display a URL and a unique device code
|
|
2. Open your browser to the authentication page
|
|
3. Prompt you to confirm the device
|
|
4. Complete the authentication process
|
|
|
|
Upon successful authentication, you'll see a confirmation message in your terminal!
|
|
|
|
</Step>
|
|
|
|
<Step title="Create a Deployment">
|
|
|
|
From your project directory, run:
|
|
|
|
```bash
|
|
crewai deploy create
|
|
```
|
|
|
|
This command will:
|
|
1. Detect your GitHub repository information
|
|
2. Identify environment variables in your local `.env` file
|
|
3. Securely transfer these variables to the Enterprise platform
|
|
4. Create a new deployment with a unique identifier
|
|
|
|
On successful creation, you'll see a message like:
|
|
```shell
|
|
Deployment created successfully!
|
|
Name: your_project_name
|
|
Deployment ID: 01234567-89ab-cdef-0123-456789abcdef
|
|
Current Status: Deploy Enqueued
|
|
```
|
|
|
|
</Step>
|
|
|
|
<Step title="Monitor Deployment Progress">
|
|
|
|
Track the deployment status with:
|
|
|
|
```bash
|
|
crewai deploy status
|
|
```
|
|
|
|
For detailed logs of the build process:
|
|
|
|
```bash
|
|
crewai deploy logs
|
|
```
|
|
|
|
<Tip>
|
|
The first deployment typically takes around 1 minute.
|
|
</Tip>
|
|
|
|
</Step>
|
|
</Steps>
|
|
|
|
## Additional CLI Commands
|
|
|
|
The CrewAI CLI offers several commands to manage your deployments:
|
|
|
|
```bash
|
|
# List all your deployments
|
|
crewai deploy list
|
|
|
|
# Get the status of your deployment
|
|
crewai deploy status
|
|
|
|
# View the logs of your deployment
|
|
crewai deploy logs
|
|
|
|
# Push updates after code changes
|
|
crewai deploy push
|
|
|
|
# Remove a deployment
|
|
crewai deploy remove <deployment_id>
|
|
```
|
|
|
|
## Option 2: Deploy Directly via Web Interface
|
|
|
|
You can also deploy your Crews or Flows directly through the CrewAI AMP web interface by connecting your GitHub account. This approach doesn't require using the CLI on your local machine. The platform automatically detects your project type and handles the build appropriately.
|
|
|
|
<Steps>
|
|
|
|
<Step title="Pushing to GitHub">
|
|
|
|
You need to push your crew to a GitHub repository. If you haven't created a crew yet, you can [follow this tutorial](/en/quickstart).
|
|
|
|
</Step>
|
|
|
|
<Step title="Connecting GitHub to CrewAI AMP">
|
|
|
|
1. Log in to [CrewAI AMP](https://app.crewai.com)
|
|
2. Click on the button "Connect GitHub"
|
|
|
|
<Frame>
|
|

|
|
</Frame>
|
|
|
|
</Step>
|
|
|
|
<Step title="Select the Repository">
|
|
|
|
After connecting your GitHub account, you'll be able to select which repository to deploy:
|
|
|
|
<Frame>
|
|

|
|
</Frame>
|
|
|
|
<Tip>
|
|
If your Crew or Flow is inside a monorepo subfolder, expand **Advanced**
|
|
and set a working directory before deploying. See
|
|
[Monorepo Deployments](/en/enterprise/guides/monorepo-deployments).
|
|
</Tip>
|
|
|
|
</Step>
|
|
|
|
<Step title="Set Environment Variables">
|
|
|
|
Before deploying, you'll need to set up your environment variables to connect to your LLM provider or other services:
|
|
|
|
1. You can add variables individually or in bulk
|
|
2. Enter your environment variables in `KEY=VALUE` format (one per line)
|
|
|
|
<Frame>
|
|

|
|
</Frame>
|
|
|
|
<Info>
|
|
Using private Python packages? You'll need to add your registry credentials here too.
|
|
See [Private Package Registries](/en/enterprise/guides/private-package-registry) for the required variables.
|
|
</Info>
|
|
|
|
</Step>
|
|
|
|
<Step title="Deploy Your Crew">
|
|
|
|
1. Click the "Deploy" button to start the deployment process
|
|
2. You can monitor the progress through the progress bar
|
|
3. The first deployment typically takes around 1 minute
|
|
|
|
<Frame>
|
|

|
|
</Frame>
|
|
|
|
Once deployment is complete, you'll see:
|
|
- Your crew's unique URL
|
|
- A Bearer token to protect your crew API
|
|
- A "Delete" button if you need to remove the deployment
|
|
|
|
</Step>
|
|
|
|
</Steps>
|
|
|
|
## Option 3: Redeploy Using API (CI/CD Integration)
|
|
|
|
For automated deployments in CI/CD pipelines, you can use the CrewAI API to trigger redeployments of existing crews. This is particularly useful for GitHub Actions, Jenkins, or other automation workflows.
|
|
|
|
<Steps>
|
|
<Step title="Get Your Personal Access Token">
|
|
|
|
Navigate to your CrewAI AMP account settings to generate an API token:
|
|
|
|
1. Go to [app.crewai.com](https://app.crewai.com)
|
|
2. Click on **Settings** → **Account** → **Personal Access Token**
|
|
3. Generate a new token and copy it securely
|
|
4. Store this token as a secret in your CI/CD system
|
|
|
|
</Step>
|
|
|
|
<Step title="Find Your Automation UUID">
|
|
|
|
Locate the unique identifier for your deployed crew:
|
|
|
|
1. Go to **Automations** in your CrewAI AMP dashboard
|
|
2. Select your existing automation/crew
|
|
3. Click on **Additional Details**
|
|
4. Copy the **UUID** - this identifies your specific crew deployment
|
|
|
|
</Step>
|
|
|
|
<Step title="Trigger Redeployment via API">
|
|
|
|
Use the Deploy API endpoint to trigger a redeployment:
|
|
|
|
```bash
|
|
curl -i -X POST \
|
|
-H "Authorization: Bearer YOUR_PERSONAL_ACCESS_TOKEN" \
|
|
https://app.crewai.com/crewai_plus/api/v1/crews/YOUR-AUTOMATION-UUID/deploy
|
|
|
|
# HTTP/2 200
|
|
# content-type: application/json
|
|
#
|
|
# {
|
|
# "uuid": "your-automation-uuid",
|
|
# "status": "Deploy Enqueued",
|
|
# "public_url": "https://your-crew-deployment.crewai.com",
|
|
# "token": "your-bearer-token"
|
|
# }
|
|
```
|
|
|
|
<Info>
|
|
If your automation was first created connected to Git, the API will automatically pull the latest changes from your repository before redeploying.
|
|
</Info>
|
|
|
|
</Step>
|
|
|
|
<Step title="GitHub Actions Integration Example">
|
|
|
|
Here's a GitHub Actions workflow with more complex deployment triggers:
|
|
|
|
```yaml
|
|
name: Deploy CrewAI Automation
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
types: [ labeled ]
|
|
release:
|
|
types: [ published ]
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
if: |
|
|
(github.event_name == 'push' && github.ref == 'refs/heads/main') ||
|
|
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'deploy')) ||
|
|
(github.event_name == 'release')
|
|
steps:
|
|
- name: Trigger CrewAI Redeployment
|
|
run: |
|
|
curl -X POST \
|
|
-H "Authorization: Bearer ${{ secrets.CREWAI_PAT }}" \
|
|
https://app.crewai.com/crewai_plus/api/v1/crews/${{ secrets.CREWAI_AUTOMATION_UUID }}/deploy
|
|
```
|
|
|
|
<Tip>
|
|
Add `CREWAI_PAT` and `CREWAI_AUTOMATION_UUID` as repository secrets. For PR deployments, add a "deploy" label to trigger the workflow.
|
|
</Tip>
|
|
|
|
</Step>
|
|
|
|
</Steps>
|
|
|
|
## Interact with Your Deployed Automation
|
|
|
|
Once deployment is complete, you can access your crew through:
|
|
|
|
1. **REST API**: The platform generates a unique HTTPS endpoint with these key routes:
|
|
|
|
- `/inputs`: Lists the required input parameters
|
|
- `/kickoff`: Initiates an execution with provided inputs
|
|
- `/status/{kickoff_id}`: Checks the execution status
|
|
|
|
2. **Web Interface**: Visit [app.crewai.com](https://app.crewai.com) to access:
|
|
- **Status tab**: View deployment information, API endpoint details, and authentication token
|
|
- **Run tab**: Visual representation of your crew's structure
|
|
- **Executions tab**: History of all executions
|
|
- **Metrics tab**: Performance analytics
|
|
- **Traces tab**: Detailed execution insights
|
|
|
|
### Trigger an Execution
|
|
|
|
From the Enterprise dashboard, you can:
|
|
|
|
1. Click on your crew's name to open its details
|
|
2. Select "Trigger Crew" from the management interface
|
|
3. Enter the required inputs in the modal that appears
|
|
4. Monitor progress as the execution moves through the pipeline
|
|
|
|
### Monitoring and Analytics
|
|
|
|
The Enterprise platform provides comprehensive observability features:
|
|
|
|
- **Execution Management**: Track active and completed runs
|
|
- **Traces**: Detailed breakdowns of each execution
|
|
- **Metrics**: Token usage, execution times, and costs
|
|
- **Timeline View**: Visual representation of task sequences
|
|
|
|
### Advanced Features
|
|
|
|
The Enterprise platform also offers:
|
|
|
|
- **Environment Variables Management**: Securely store and manage API keys
|
|
- **LLM Connections**: Configure integrations with various LLM providers
|
|
- **Custom Tools Repository**: Create, share, and install tools
|
|
- **Crew Studio**: Build crews through a chat interface without writing code
|
|
|
|
## Troubleshooting Deployment Failures
|
|
|
|
If your deployment fails, check these common issues:
|
|
|
|
### Build Failures
|
|
|
|
#### Missing uv.lock File
|
|
|
|
**Symptom**: Build fails early with dependency resolution errors
|
|
|
|
**Solution**: Generate and commit the lock file:
|
|
|
|
```bash
|
|
uv lock
|
|
git add uv.lock
|
|
git commit -m "Add uv.lock for deployment"
|
|
git push
|
|
```
|
|
|
|
<Warning>
|
|
The `uv.lock` file is required for all deployments. Without it, the platform
|
|
cannot reliably install your dependencies.
|
|
</Warning>
|
|
|
|
#### Wrong Project Structure
|
|
|
|
**Symptom**: "Could not find entry point" or "Module not found" errors
|
|
|
|
**Solution**: Verify your project matches the expected structure:
|
|
|
|
- **JSON-first Crews**: Keep `crew.jsonc` or `crew.json` and `agents/` at the project root
|
|
- **Classic Crews**: Use `src/project_name/main.py` with a `run()` entry point
|
|
- **Flows**: Use `src/project_name/main.py` with a `kickoff()` entry point
|
|
|
|
See [Prepare for Deployment](/en/enterprise/guides/prepare-for-deployment) for detailed structure diagrams.
|
|
|
|
#### Missing CrewBase Decorator in a Classic Crew
|
|
|
|
**Symptom**: "Crew not found", "Config not found", or agent/task configuration errors
|
|
|
|
**Solution**: For classic Python/YAML crews, ensure all crew classes use the `@CrewBase` decorator. JSON-first crews do not need this decorator.
|
|
|
|
```python
|
|
from crewai.project import CrewBase, agent, crew, task
|
|
|
|
@CrewBase # This decorator is REQUIRED
|
|
class YourCrew():
|
|
"""Your crew description"""
|
|
|
|
@agent
|
|
def my_agent(self) -> Agent:
|
|
return Agent(
|
|
config=self.agents_config['my_agent'], # type: ignore[index]
|
|
verbose=True
|
|
)
|
|
|
|
# ... rest of crew definition
|
|
```
|
|
|
|
<Info>
|
|
This applies to classic Python crew classes, including classic crews embedded inside Flow projects.
|
|
JSON-first crews are validated from `crew.jsonc` and `agents/` instead.
|
|
</Info>
|
|
|
|
#### Incorrect pyproject.toml Type
|
|
|
|
**Symptom**: Build succeeds but runtime fails, or unexpected behavior
|
|
|
|
**Solution**: Verify the `[tool.crewai]` section matches your project type:
|
|
|
|
```toml
|
|
# For Crew projects:
|
|
[tool.crewai]
|
|
type = "crew"
|
|
|
|
# For Flow projects:
|
|
[tool.crewai]
|
|
type = "flow"
|
|
```
|
|
|
|
### Runtime Failures
|
|
|
|
#### LLM Connection Failures
|
|
|
|
**Symptom**: API key errors, "model not found", or authentication failures
|
|
|
|
**Solution**:
|
|
1. Verify your LLM provider's API key is correctly set in environment variables
|
|
2. Ensure the environment variable names match what your code expects
|
|
3. Test locally with the exact same environment variables before deploying
|
|
|
|
#### Crew Execution Errors
|
|
|
|
**Symptom**: Crew starts but fails during execution
|
|
|
|
**Solution**:
|
|
1. Check the execution logs in the AMP dashboard (Traces tab)
|
|
2. Verify all tools have required API keys configured
|
|
3. For JSON-first crews, validate `crew.jsonc` and the referenced files in `agents/`
|
|
4. For classic crews, ensure `agents.yaml` and `tasks.yaml` are valid
|
|
|
|
<Card title="Need Help?" icon="headset" href="mailto:support@crewai.com">
|
|
Contact our support team for assistance with deployment issues or questions
|
|
about the AMP platform.
|
|
</Card>
|