Loading...
Loading...
Getting a CrewAI crew or flow onto CrewAI AMP: the project shape the build expects (uv.lock, [tool.crewai] type, src/<pkg>/ entry points, a real Flow subclass, absolute imports, a self-contained root), `crewai deploy validate`, the three deploy paths (CLI create/push, GitHub, ZIP upload) and what each one actually uploads, env vars per deployment and what the CLI re-sends from .env, provider keys and extras, and machine-wide org selection. Use when running `crewai deploy create` / `crewai deploy push` / `crewai deploy validate`, when a deploy says Online but runs old code, old env values or lost a key, or when pasting errors like `missing_lockfile`, `Crew class annotated with @CrewBase not found`, `No Flow subclass found`, `Expected to find at least one of these files: uv.lock or poetry.lock`, `OPENAI_API_KEY is required`, `Anthropic native provider not available`, `deployment_not_found`, `git_clone_failure`, `Automation error, fix the code and deploy again`, or `pyproject.toml not found`.
npx skill4agent add crewaiinc/skills deploy-to-ampcrewai versionask-docscrewai org current # which org will receive this deploy (machine-wide, see section 5)
uv lock && git status # lockfile fresh, and you know what is uncommitted
crewai deploy validate # local checks, no platform contact, exit 1 on blocking errorscrewai deploy createcrewai deploy push--skip-validatecrewai deploystatus --uuidError: pyproject.toml not found.crewai deploy validatecreatepushPre-deploy validation failed. Fix the issues above or re-run with --skip-validate.statuslogsdeployment_not_foundcrewai deploy validate$?~/Library/Application Support/<pkg>/CREWAI_STORAGE_DIR| Requirement | Crew (classic, | Flow ( |
|---|---|---|
| Deployment name | | same |
| | |
| Lockfile | | same |
| Package dir | | same |
| Entry code | | |
| Scripts (scaffold) | | |
| Imports | absolute: | absolute: |
crewai create crew <name>--classiccrew.jsoncagents/src/crewai deploy validatemain.pyfrom crewai.flow import Flow, listen, start
from pydantic import BaseModel
class ReportState(BaseModel):
topic: str = "AI agents"
summary: str = ""
class ReportFlow(Flow[ReportState]):
@start()
def gather(self):
return f"notes on {self.state.topic}"
@listen(gather)
def summarize(self, notes):
self.state.summary = notes.upper()
return self.state.summary
def kickoff():
ReportFlow().kickoff()
if __name__ == "__main__":
kickoff()| Bad | What happens | Good |
|---|---|---|
| | |
Only a | | Define |
Flow | | Pass per-run values through |
| | |
| | |
Renamed | | Keep the dir equal to the normalized |
| | |
Edited | | Re-run |
Importing code from a sibling dir ( | Validate passes locally, but only the project root is uploaded: the AMP build fails with | Move shared code inside |
| Locally: | |
src/<pkg>/src/<pkg>/from importlib.resources import files
rules = files("research_crew").joinpath("data/rules.json").read_text()@CrewBase not foundNo Flow subclass found# 1. Run the file outside its package, as the loader does (catches relative imports and import-time errors)
uv run python -c "import runpy; runpy.run_path('src/research_crew/crew.py', run_name='deploy_check')" # flows: src/<pkg>/main.py
# 2. Build the object with no arguments (catches missing provider extras and Flow `__init__` arguments)
uv run python -c "from research_crew.crew import ResearchCrew; ResearchCrew().crew()"
uv run python -c "from acme_flow.main import ContentFlow; ContentFlow()"| Path | Code AMP builds | Env vars sent |
|---|---|---|
| AMP clones the repo; nothing is uploaded from your disk. AMP needs read access to the repo through a connection in the AMP org (Settings > Git Repositories: GitHub OAuth or Any Git Repository) - otherwise create still prints | Every key in local |
| A ZIP of your working tree (prints | Every key in local |
| Nothing is uploaded; AMP rebuilds from the deployment's own source | None |
| A fresh ZIP of your working tree, including uncommitted edits | Every key in local |
| Dashboard, Deploy from Code (GitHub OAuth or Git Repository tab) | The repository and branch you pick from a connection (optional auto-deploy on new commits) | What you enter in the dashboard |
| Dashboard, ZIP upload | The ZIP you choose | What you enter in the dashboard |
pushorigin| Deployment created as | Local state at | Result |
|---|---|---|
| ZIP | | No ZIP uploaded; AMP rebuilt the last uploaded ZIP. Working-tree code and |
| Git | | CLI uploaded a ZIP and |
origincreatePreparing project ZIP...Uploading project ZIP...Crew is Onlinegit commitgit pushcrewai deploy push.env.env.*.env.example.env.sample.git.venvbuild/dist/report.mdoutput/.gitignore.gitignore.env.examplegit initcreatepushuv.lockuv runcreatepushcrewai installpush--uuid[project].name--uuidpushpushcrewai deploy statuscrewai deploy logsModuleNotFoundError ...git_clone_failureAutomation error, fix the code and deploy again.Provisioning Failed, try again.Something went wrong, try again.Crew is OnlineFAILEDValueError: ANTHROPIC_API_KEY is requiredcall-deployed-crewOPENAI_API_KEYANTHROPIC_API_KEYSERPER_API_KEY.env| Situation | What gets sent |
|---|---|
| Every non-comment |
| The same, and the deployment's variables are replaced by exactly this set: a key missing from |
| No env fields at all (it prints |
| Never sends env vars - change values in the dashboard. A Git-based deployment keeps the values from its |
MAX_CASES=3 # note3 # note3QUOTED="abc".envcrewai deploy push.env.env.env.example<your-key>llm=gpt-4.1-miniOPENAI_API_KEYllm=api_key=ValueError: OPENAI_API_KEY is requiredValueError: ANTHROPIC_API_KEY is requiredcrewai[anthropic]crewai[google-genai]crewai[bedrock]crewai[azure-ai-inference]uv addpyproject.tomluv.lockcreatepushcrewai deploy validateenv_vars_not_in_dotenvos.getenv("SERPER_API_KEY").env~/.config/crewai/settings.jsondeploy create/push/status/logs/list/removecrewai org currentcrewai orgcurrentcrewai org listcrewai org switch <org-id>crewai logincrewai org currentdeployment_not_foundRequest to Enterprise API failed. Details: deployment_not_found[project].namecreatecrewai org current--uuid| Symptom | Cause | Fix |
|---|---|---|
| Deploy is Online but runs old code | Git-based deployment and the change was not pushed; or a ZIP deployment pushed from a tree that now has an | |
Deploy keeps old env values after editing | Push with a local | Edit the values in the dashboard |
| A stale value overwrites a rotated key, an unrelated secret appears on the deployment, or a key vanished | ZIP | Deploy from a tree without |
Kickoff | Key missing on the deployment (often removed by a ZIP push with a partial | Set it in the dashboard, or push with a complete |
| Git-based deployment and AMP has no access to the (private) repo | Check Settings > Git Repositories in the AMP org: if it only offers "Configure GitHub" / "Add Repository", nothing is connected. Connect GitHub (or add the repo) with access to this repository, then push again: a deployment created from the CLI picks up the connection on its next |
| The AMP build's import test failed | |
| Inline comment in | Bare values only |
| No lockfile | |
Validate passed on the second run although you never ran | Validate's import check ran | Commit the new |
| Relative import, missing provider extra, or any import error in | Run the diagnostic commands in section 2 to see the real error |
| No Flow class, Flow needs constructor args, or | Add a no-arg Flow subclass; fix |
| Imports from outside the project root | Move it under |
| Extra missing from | |
| Agent without | Set |
| Wrong org selected, or | |
| Run outside a project dir | |
| Deployment from a monorepo subfolder fails to find the project | Only the repo or ZIP root is used by default | Set the working directory in the dashboard |
crewai org current[tool.crewai] typesrc/<pkg>/[project].name@CrewBaseconfig/*.yamlFlowkickoff()crewai[anthropic]uv adduv lockpyproject.tomluv.lockcrewai deploy validateorigin.envUploading project ZIP...crewai deploy validate/inputs/kickoff/statuscrewai runLLM