Skip to main content
    Ivy Biosciences Docs/Call the platform/API/SDKs/SDK jobs

    SDK jobs

    JobManager methods for submission, polling, real-time monitoring, listing, and deletion

    The JobManager — reached through ivy.jobs — is how you run computational work: submit a tool, watch its progress, list or cancel jobs, and delete them when done. Reach for it whenever you're driving a compute job from TypeScript, from a fire-and-forget submit() to the all-in-one submitAndWait() that submits and blocks until the job finishes. It sits on the Client you construct first; once a job completes, the Artifacts reference covers downloading its output files.

    SDK Jobs Reference

    Planned specification. @ivybiosciences/sdk is not released, and there is no package to install. This page describes the SDK's planned interface. To call the platform today, use the REST API, the ivybloom CLI, or the MCP server.

    The JobManager handles the full lifecycle of computational jobs: submission, status polling, real-time monitoring, listing, and deletion.

    Access via ivy.jobs.


    jobs.submit(params)

    Submit a new computational job. Returns immediately with the job ID.

    async submit(params: SubmitJobParams): Promise<{
      id: string
      status: string
      taskId?: string
    }>

    Parameters:

    FieldTypeRequiredDescription
    params.toolNamestringYesComputational tool (e.g., "esmfold", "diffdock")
    params.parametersRecord<string, unknown>YesTool-specific input parameters
    params.projectIdstringNoProject to associate with
    params.jobTitlestringNoHuman-readable title
    params.orgIdstringNoOrganization ID for team-scoped jobs
    params.analysisLevel"basic" | "standard" | "comprehensive"NoAnalysis depth (default: "standard")

    Returns:

    FieldTypeDescription
    idstringUnique job identifier for status queries
    statusstringInitial status (typically "pending")
    taskIdstring?Modal task ID for infrastructure tracking

    Throws: IvyApiError on validation (422), auth (401/403), or server (5xx) errors.

    Examples

    const { id, taskId } = await ivy.jobs.submit({
      toolName: "esmfold",
      parameters: { protein_sequence: "MKFLILLFNILCLFPVLAADNH" },
      analysisLevel: "comprehensive",
    })
    console.log(`Job ${id} submitted (task: ${taskId})`)

    jobs.getStatus(jobId)

    Get the current status of a job. Lightweight endpoint suitable for polling.

    async getStatus(jobId: string): Promise<JobProgress>

    Parameters:

    ParameterTypeDescription
    jobIdstringThe job identifier

    Returns: JobProgress — current status, progress %, phase, and results.

    Throws: IvyApiError with isNotFound if the job doesn't exist.

    Examples

    let status = await ivy.jobs.getStatus("job_abc123")
    while (status.status !== "COMPLETED" && status.status !== "FAILURE") {
      await new Promise(r => setTimeout(r, 3000))
      status = await ivy.jobs.getStatus("job_abc123")
    }
    console.log(status.result)

    jobs.getDetails(jobId)

    Get full job details including parameters, timestamps, and metadata.

    async getDetails(jobId: string): Promise<Record<string, unknown>>

    More expensive than getStatus — use for detailed inspection, not polling.

    Throws: IvyApiError with isNotFound if the job doesn't exist.

    Examples

    const details = await ivy.jobs.getDetails("job_abc123")
    console.log(details.created_at, details.tool_name, details.analysis_level)

    jobs.list(options?)

    List the authenticated user's jobs with pagination.

    async list(options?: { skip?: number; limit?: number }): Promise<Record<string, unknown>[]>

    Parameters:

    ParameterTypeDefaultDescription
    options.skipnumber0Number of jobs to skip (offset)
    options.limitnumber100Maximum jobs to return

    Returns: Array of job records, ordered by creation time (newest first).

    Examples

    const jobs = await ivy.jobs.list({ limit: 10 })
    for (const job of jobs) {
      console.log(`${job.id}: ${job.status} (${job.tool_name})`)
    }

    jobs.delete(jobId)

    Delete a job and its associated S3 artifacts. Irreversible.

    async delete(jobId: string): Promise<void>

    Throws:

    • IvyApiError with isNotFound if the job doesn't exist.
    • IvyApiError with isForbidden if the job belongs to another user.

    Examples

    await ivy.jobs.delete("job_abc123")

    Cancelling a job

    JobManager has no cancel method. In React, the cancel function returned by useIvyJob stops the hook tracking the job on the client; it does not stop the job on the backend. To remove a job, use jobs.delete.


    jobs.submitAndWait(params, options?)

    Submit a job and wait for it to reach a terminal state. The highest-level convenience method.

    async submitAndWait(
      params: SubmitJobParams,
      options?: SubmitAndWaitOptions,
    ): Promise<JobProgress>

    Strategy:

    1. Submits the job via HTTP POST
    2. Subscribes to WebSocket updates (if useWebSocket is true)
    3. Falls back to HTTP polling if WebSocket fails
    4. Resolves when status is COMPLETED, FAILURE, or CANCELLED

    Options:

    FieldTypeDefaultDescription
    onProgress(progress: JobProgress) => void—Called on each status change
    pollIntervalnumber3000Polling interval in ms (fallback mode)
    timeoutnumber600000Max wait time in ms (10 minutes)
    useWebSocketbooleantrueUse WebSocket for real-time updates

    Returns: Final JobProgress with status, results, and/or errors.

    Throws:

    • IvyTimeoutError if the job doesn't finish within the timeout.
    • IvyApiError on submission or polling errors.

    Examples

    const result = await ivy.jobs.submitAndWait(
      {
        toolName: "diffdock",
        parameters: { protein_pdb: "...", ligand_smiles: "CCO" },
      },
      {
        onProgress: (p) => console.log(`[${p.phase}] ${p.progress}%`),
        timeout: 300_000, // 5 minutes
      }
    )
    
    if (result.status === "COMPLETED") {
      const pdbUrl = result.presignedUrl
      // Download the docked structure...
    }

    Job Lifecycle

    Job status lifecycle.

    Standard Phases

    PhaseProgressDescription
    initialization~5%Input validation
    data_preprocessing~15%Data loading and prep
    model_loading~10%ML model initialization
    main_computation~50%Core processing
    post_processing~15%Result analysis
    result_generation~5%Format and store

    Analysis Levels

    LevelDescriptionData Fields
    basicFast results, minimal metricsStandard output only
    standardBalanced analysis (default)Key quality metrics
    comprehensiveFull analytical suite5-10x more fields

    Was this page helpful?

    On this page

    On this page

    Loading...