WBX Sandbox
Jobs and batches

Passing files between jobs

inputs gives a job the result files of your earlier finished jobs without downloading and uploading them again.

Use the results of another job

from wbxsandbox import run_job, job_input

prep = run_job(command="python prepare.py", save_artifacts=True).wait()
report = run_job(command="python report.py input/data.csv",
                 inputs=[job_input(prep.id, "output/data.csv", "data.csv")])
curl -s -X POST https://sandbox.wbx.cz/v1/jobs -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"command": "python report.py input/data.csv",
       "inputs": [{"job_id": "JOB_ID", "name": "output/data.csv", "as": "data.csv"}]}'

How it works

  • Each input is {"job_id": "…", "name": "output/data.csv", "as": "data.csv"}; as is optional (the base name is used).
  • A job in a virtual machine finds them in ./input/ of its working directory, a WebAssembly job in /input/.
  • Up to 32 files and 64 MB per job. Need more? Pack the files into one archive in the earlier job.
  • The SHA-256 is checked when the job is accepted and again when it starts, and the job's receipt lists each input file with its SHA-256.
  • Only your own jobs can be used, and only while their results are kept (7 days).
  • Inside a batch, from_index instead of job_id refers to another job of the same batch, and the job waits for it.