Submitting to a Workflow

Introduction

Submitting a document to an Indico Workflow is a straightforward process and supports multiple upload types. The WorflowSubmission query returns a list of submission IDs that can be queried with other Indico SDK calls.

Prerequisite

Ensure that the models associated with the Workflow have all been trained and are in good order before making a submission.

WorkflowSubmission

Upload Types

  • 📁 local files - All SDKs
  • 📄 plain text - Python only
  • Data streams - All SDKS
  • Urls - Python and C# only

For a complete list of supported file types, check out our use guides.

Inputs

📥

WorkflowSubmission Inputs

submission_id: int Submission id

Outputs

📤

WorkflowSubmission Outputs

Found Submission object

Try It Out

Try out WorkflowSubmission below:

workflow_id = 42
path_to_files = ["./workflow-sample.pdf"]

submission_ids = client.call(
    WorkflowSubmission(workflow_id=workflow_id, files=path_to_files)
)

# Wait = True here will cause the SDK to wait until the submission is successful or failed.
submission = client.call(SubmissionResult(submission_ids[0], wait=True))
result = client.call(RetrieveStorageObject(submission.result))
print(result) #or otherwise view and process as you see fit.
client.call(UpdateSubmission(submission_ids[0], retrieved=True))
using System;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using IndicoV2;

namespace Examples
{
    public class SubmitWorkflows
    {
        private static string GetToken() =>
            File.ReadAllText(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
                "indico_api_token.txt"));

        public static async Task Main()
        {
            var client = new IndicoClient(GetToken(), new Uri("https://your-cluster.example.com"));

            var workflowId = 42;
         		var filepaths = new[] {"workflow-sample.pdf"}
            var submissionClient = client.Submissions();

            var submissionIds = await submissionClient.CreateAsync(workflowId, filepaths});
            int submissionId = submissionIds.Single();
          
            var submission = await submissionClient.GetAsync(submissionId);
            //Wait option is "WaitReady" here.
            var submissionResult = await client.GetSubmissionResultAwaiter().WaitReady(submissionId);
          	
            var retrieved = await _submissionsClient.MarkSubmissionAsRetrieved(submissionId);
            Console.ReadLine();
        }
    }
}
package com.indico;

import com.indico.entity.Submission;

import com.indico.mutation.WorkflowSubmission;

import java.util.ArrayList;
import java.util.List;


public class main {

    public IndicoClient client;
    private static String token_path = "./indico_api_token.txt";
    private static String host  =  "mycluster.indico.io"
    private static Integer workflow_id = 1;

    public static void main(String args[]) throws Exception {

        
        IndicoConfig config = new IndicoConfig.Builder().host(host)
                .protocol("https")
                .tokenPath(token_path)
                .build();
        client = new IndicoKtorClient(config);

        WorkflowSubmission submitFile = client.workflowSubmission();
        List<String> files = new ArrayList<String>();
        files.add("./workflow-example.pdf");
        List<Integer> ids = submitFile.files(files)
                .workflowId(workflow_id)
                .execute();

        System.exit(0);

    }
}