You can use webhooks to get notified by Tensorlake when -

  • A Document AI Job finishes with a success or failure status.
  • When a Serverless Workflow finishes running for a given Input.

Why use Webhooks?

If you are parsing documents which are large, or processing a large number of documents, they are most likely to take longer to process and your connection might timeout.

Webhooks allow you to get notified when a job finishes, so you can call back Tensorlake APIs to get the parsed output.

Document AI Webhook Payload

The following payload is sent to your configured webhook URL when a job finishes.

{
    "job_id": "job_XXXX",
    "status": "success"
}

The following statuses are possible -

  • success - The job finished successfully.
  • failure - The job failed to finish.
  • processing - The job is still processing.

Webhook Configuration

You can configure your webhook URL by calling the Configure Webhook API.

Testing Webhooks

We use Svix to deliver webhooks, they have a convenient UI to test webhooks.

Simply configure a Play endpoint on Svix, and then call the Tensorlake API to parse a document, and see it delivered to your play endpoint.

Serverless Workflow Webhook Payload

The following payload is sent to your configured webhook URL when all functions of a Serverless Workflow finishes running for a given Input.

{
    "workflow_name": "workflow_XXXX",
    "invocation_id": "invocation_XXXX",
    "fn_status": {
        "fn_A": "success",
        "fn_B": "failure"
    }
}

The following statuses are possible for each function -

  • success - The function finished running successfully.
  • failure - The function failed to finish running.

Was this page helpful?