Skip to main content

Create a Job

POST 

/api/workspaces/:workspace_id/entities/:id/jobs/

Creates a Job. For the simplest computation flow, set poll_result=false or do not include it in the payload. This will ensure that the end-point always responds with:

  • 201: job is still running, start polling on the /jobs/UID/ end-point, provided under "url" key. (see Jobs end-points)

Setting poll_result=true is only useful for very quick jobs, since the BE polls checks internally for job completion for a short period before responding with either:

  • 200: job returned with full response.
  • 201: job is still running, start polling on the /jobs/UID/ end-point, provided under "url" key. (see Jobs end-points)

Request

Path Parameters

    workspace_id stringrequired
    id integerrequired

    A unique integer value identifying this entity.

Body

required

    poll_result boolean

    Let the endpoint temporarily poll for the result.

    method_name string

    Possible values: non-empty

    Name to the method to run the App Job.

    method_type string

    Possible values: non-empty

    Type to the method to run the App Job.

    editor_session uuid

    UUID of the current editor session. This field is required when called under public endpoints.

    params objectnullable

    Default value: [object Object]

    (Optional) params as input for App Job.

    events string[]

    Default value: ``

    (Optional) events as input for App Job.

    timeout integer

    Possible values: >= 1 and <= 86400

    Default value: 86400

    (Optional) max job duration as input for App Job.

    arguments objectnullable

    Default value: [object Object]

    (deprecated) replaced with params.

    method string

    Possible values: non-empty

    (deprecated) replaced with method_name.

Responses

Schema

    uid integer

    The uid of the AppJob.

    message string

    Possible values: non-empty

    Progress message when app runner is still processing the job.

    kind string

    Possible values: non-empty

    The result payload kind.

    status string

    Possible values: non-empty

    Status of the AppJob. 'success' | 'error' | 'error_user' | 'stopped' | 'message'.

    error_message string

    Possible values: non-empty

    If error is raised, the error message returned.

    error_stack_trace object

    If error is raised, the stack trace is returned.

    invalid_fields object

    Any invalid fields that were found during the Job.

    content object

    The actual result content.

Loading...