Skip to main content
This example uses examples/python/agent_deployments/crewai_job/nullspace.agent.toml to package a CrewAI project, run crewai run as a finite job, and publish declared outputs.

Setup

python -m pip install "nullspace-sdk[cli]==0.1.9"
export NULLSPACE_API_KEY=ns_live_...
export NULLSPACE_API_URL=https://api.your-nullspace-domain
export OPENAI_API_KEY=sk-...
cd examples/python/agent_deployments/crewai_job

CLI

nullspace agent deploy .

nullspace agent run crewai-report-job \
  --input-json '{"topic":"release risks"}' \
  --env OPENAI_API_KEY="$OPENAI_API_KEY" \
  --json

nullspace agent logs crewai-report-job --run adrun_123
nullspace agent outputs crewai-report-job --run adrun_123
nullspace agent status crewai-report-job --run adrun_123
Expected output includes output metadata for result.json and reports/report.md.

Config

name = "crewai-report-job"
mode = "job"
install = "python -m pip install -e ."
entrypoint = "crewai run"

[env]
required = ["OPENAI_API_KEY"]

[outputs]
paths = ["result.json", "reports"]

Python

The companion run.py script uses the same deployment contract through the SDK:
from pathlib import Path

from nullspace import AgentDeployment

project = Path(__file__).resolve().parent
deployment, version, manifest = AgentDeployment.deploy(path=project)
run = deployment.run(
    input={"topic": "release risks"},
    envs={"OPENAI_API_KEY": "..."},
    retain_on_failure=True,
)
outputs = deployment.run_outputs(run.id)
print(deployment.name, version.id, len(manifest.entries), len(outputs.outputs))
Run the complete script:
python run.py
Related: CrewAI and Agent Deployments.