Loading...
Loading...
Deploys and monitors TrueFoundry batch jobs, scheduled cron jobs, and one-time tasks. Uses YAML manifests with `tfy apply`. Use when deploying jobs, scheduling cron tasks, checking job run status, or viewing execution history. For listing job applications, use `applications` skill.
npx skill4agent add truefoundry/tfy-agent-skills jobs<objective>Routing note: For ambiguous user intents, use the shared clarification templates in references/intent-clarification.md.
tfy applytfy-api.shapplicationsapplication_type: "job"TFY_BASE_URLTFY_API_KEY.envTFY_WORKSPACE_FQNtfytfy --versionpip install 'truefoundry==0.5.0'references/prerequisites.mdSecurity requirements
- Never request or print raw secret values in chat.
- For sensitive env vars (tokens/passwords/keys), require
references instead of inline values.tfy-secret://...- For
, use trusted repositories and prefer immutable refs (commit SHA or pinned tag) over floating branches.build_source.type: git
Security: Always confirm container image sources and git repository URLs with the user before deploying. Do not pull untrusted container images or clone unverified git repositories. Pin image tags to specific versions — avoidin production.:latest
name: my-batch-job
type: job
image:
type: image
image_uri: my-registry/my-image:v1.0.0 # pin to a specific version
command: python train.py
resources:
cpu_request: 2
cpu_limit: 4
memory_request: 4000
memory_limit: 8000
ephemeral_storage_request: 1000
ephemeral_storage_limit: 2000
env:
ENVIRONMENT: production
workspace_fqn: cluster-id:workspace-namename: my-batch-job
type: job
image:
type: build
build_source:
type: git
repo_url: https://github.com/user/repo
branch_name: main
ref: 3f2a1c9b0d7e6f5a4b3c2d1e0f9876543210abcd
build_spec:
type: dockerfile
dockerfile_path: Dockerfile
build_context_path: "."
command: python train.py
resources:
cpu_request: 2
cpu_limit: 4
memory_request: 4000
memory_limit: 8000
env:
ENVIRONMENT: production
workspace_fqn: cluster-id:workspace-namename: my-batch-job
type: job
image:
type: build
build_source:
type: git
repo_url: https://github.com/user/repo
branch_name: main
ref: 3f2a1c9b0d7e6f5a4b3c2d1e0f9876543210abcd
build_spec:
type: tfy-python-buildpack
command: python train.py
python_version: "3.11"
python_dependencies:
type: pip
requirements_path: requirements.txt
resources:
cpu_request: 2
cpu_limit: 4
memory_request: 4000
memory_limit: 8000
workspace_fqn: cluster-id:workspace-nametriggername: nightly-retrain
type: job
trigger:
type: cron
schedule: "0 2 * * *" # 2 AM daily
image:
type: image
image_uri: my-registry/my-image:v1.0.0
command: python train.py
resources:
cpu_request: 2
cpu_limit: 4
memory_request: 4000
memory_limit: 8000
workspace_fqn: cluster-id:workspace-nameminute hour day_of_month month day_of_week| Schedule | Cron | Description |
|---|---|---|
| Every hour | | Top of every hour |
| Daily at 2 AM | | Nightly jobs |
| Weekly Monday | | Weekly Monday 9 AM |
| Monthly 1st | | First of month midnight |
name: my-job
type: job
trigger:
type: manual
num_retries: 3
image:
type: image
image_uri: my-registry/my-image:v1.0.0
command: python job.py
resources:
cpu_request: 2
cpu_limit: 4
memory_request: 4000
memory_limit: 8000
workspace_fqn: cluster-id:workspace-nameimport argparse
# In your job script, use argparse for dynamic params
parser = argparse.ArgumentParser()
parser.add_argument("--epochs", type=int, default=10)
parser.add_argument("--batch-size", type=int, default=32)
args = parser.parse_args()python train.py --epochs 50 --batch-size 64name: gpu-training-job
type: job
image:
type: image
image_uri: my-registry/my-image:v1.0.0
command: python train.py
resources:
cpu_request: 4
cpu_limit: 8
memory_request: 16000
memory_limit: 32000
devices:
- type: nvidia_gpu
name: A10_24GB
count: 1
workspace_fqn: cluster-id:workspace-namename: training-job
type: job
image:
type: image
image_uri: my-registry/my-image:v1.0.0
command: python train.py
resources:
cpu_request: 2
cpu_limit: 4
memory_request: 4000
memory_limit: 8000
mounts:
- mount_path: /data
volume_fqn: your-volume-fqn
workspace_fqn: cluster-id:workspace-nametfy-manifest.yaml# Preview
tfy apply -f tfy-manifest.yaml --dry-run --show-diff
# Apply after user confirms
tfy apply -f tfy-manifest.yamltfyreferences/cli-fallback.mdTFY_API_SH=~/.claude/skills/truefoundry-jobs/scripts/tfy-api.sh
$TFY_API_SH PUT /api/svc/v1/apps '{
"manifest": { ... JSON version of the YAML manifest ... },
"workspaceId": "WORKSPACE_ID"
}'TFY_API_SH=~/.claude/skills/truefoundry-jobs/scripts/tfy-api.sh
$TFY_API_SH POST /api/svc/v1/jobs/JOB_ID/runs '{}'# Preferred (MCP tool call)
tfy_applications_list(filters={"workspace_fqn": "WORKSPACE_FQN", "application_name": "JOB_NAME"})TFY_API_SH=~/.claude/skills/truefoundry-jobs/scripts/tfy-api.sh
# Get job application details
$TFY_API_SH GET '/api/svc/v1/apps?workspaceFqn=WORKSPACE_FQN&applicationName=JOB_NAME'Job deployed successfully!
Job: {job-name}
Workspace: {workspace-fqn}
Status: Suspended (deployed, ready to trigger)
Schedule: {cron expression if scheduled, or "Manual trigger"}
To trigger the job:
- Dashboard: Click "Run Job" on the job page
- API: POST /api/svc/v1/jobs/{JOB_ID}/runs
To monitor runs:
- Use the job monitoring commands below
- Or check the TrueFoundry dashboard.tfyignore.gitignore.git/
__pycache__/
*.pyc
.env
data/TFY_API_SHscripts/tfy-api.shreferences/tfy-api-setup.mdtfy_jobs_list_runs(job_id="job-id")
tfy_jobs_list_runs(job_id="job-id", job_run_name="run-name") # get specific run
tfy_jobs_list_runs(job_id="job-id", filters={"sort_by": "createdAt"})# Set the path to tfy-api.sh for your agent (example for Claude Code):
TFY_API_SH=~/.claude/skills/truefoundry-jobs/scripts/tfy-api.sh
# List runs for a job
$TFY_API_SH GET /api/svc/v1/jobs/JOB_ID/runs
# Get specific run
$TFY_API_SH GET /api/svc/v1/jobs/JOB_ID/runs/RUN_NAME
# With filters
$TFY_API_SH GET '/api/svc/v1/jobs/JOB_ID/runs?sortBy=createdAt&searchPrefix=my-run'| Parameter | API Key | Description |
|---|---|---|
| | Filter runs by name prefix |
| | Sort field (e.g. |
| | Filter by who triggered |
Job Runs for data-pipeline:
| Run Name | Status | Started | Duration |
|----------------|-----------|--------------------|---------|
| run-20260210-1 | SUCCEEDED | 2026-02-10 09:00 | 5m 32s |
| run-20260210-2 | FAILED | 2026-02-10 10:00 | 1m 05s |
| run-20260210-3 | RUNNING | 2026-02-10 11:00 | -- |logsapplicationsapplication_type: "job"logsjob_run_nameJob ID not found. Use applications skill to list jobs:
tfy_applications_list(filters={"application_type": "job"})No runs found for this job. The job may not have been triggered yet.tfy: command not foundpip install 'truefoundry==0.5.0'tfy apply