Custom Pipelines

Pipeline templates are used for the flexibility of combining procedures not covered by the graphical UI.

A pipeline template consist of a yaml definition of processors with input/output defined for each step.

The output of pipelines can be stored by using the output syntax $(outputName) and then referenced in the subsequent processors as input.

Input parameters can either be literals or references defined in the pipeline definition.

DocumentToHtml

Converts a document to a HTML representation. Currently Word only.

Returns a HTML document as a text string.

- !DocumentToHtml
  inputs:
    fileFormat: docx
    data: document to convert
  output: $(outputName) 

fileFormat specifies the input format.

data specifies the binary document to convert.

DocumentToPlainText

Converts a document to a plain text representation. Currently Word only.

Returns a plain text string.

- !DocumentToPlainText
  inputs:
    fileFormat: docx
    data: document to convert
  output: $(outputName) 

fileFormat specifies the input format.

data specifies the binary document to convert.

GenerateTemplafy

Generate a document from a Templafy One template using a service account.

Returns a binary document.

- !GenerateTemplafy
  inputs:
    token: token
    templateId: templafy template identifier
    userProfileId: service account profile id
    data: input to the form data bindings
output: $(outputName) 

token specifies the service account token used to generate the document/presentation from Templafy. Token can be acquired by Omnidocs, valid for a single Templafy tenant.

templateId specifies the unique identifier for a template in Templafy.

userProfileId specifies the service account user profile used for generating the document. Identifier can be acquired by Omnidocs, valid for a single Templafy tenant.

data specifies the data json forwarded as input to the Templafy dynamic template.

JmesPath

Perform data transformation beyond the input data transformation.

Returns a json text string.

- !JmesPath
  inputs:
    json: json to transform
    jmes: data transformation
  output: $(outputName) 

json specifies the data to transform.

jmes specifies the transformation to perform.

OfficeToPdf

Converts a binary document/presentation to a PDF.

Returns binary PDF.

- !OfficeToPdf
  inputs:
    fileFormat: docx/pptx
    document: document to convert
  output: $(outputName) 

fileFormat specifies the input format.

document specifies the binary document to convert.

QueryString

Read additional data from a custom API query parameter and use it in the pipeline.

Returns the string value of the query parameter.

- !QueryString
  inputs:
    paramKey: parameter name
    defaultValue: default value
  output: $(outputName) 

paramKey specifies the name of the query parameter to read from in the pipeline.

defaultValue specifies the default value if the parameter is omitted from the request.

ReadBack

Provides the ability to read back the original input dataset updated with user changes to the document content controls in Word.

- !ReadBack
  inputs:
    fileFormat: docx/pptx
    data: base64 encoded document
output: $(outputName)

fileFormat specifies the type of input file.

data specifies the base 64 encoded document. Use body of request $(body).

Response

Can be used as a last step of the pipeline to set the return value for the response.

- !Response
  inputs:
    body: value
    mimeType: mime type 

body specifies the value to set as the response

mimeType specifies the mime type for the pipeline handler to finalize.

RunTemplate

Executes the DocuMotor templating engine on the input document/presentation template.

Returns the document as binary.

- !RunTemplate
  inputs:
    fileFormat: docx/pptx
    template: binary template
    data: data to insert
    trimPageBreaks: true/false
    removeContentControls: true/false
    enableReadBack: true/false
  output: $(outputName) 

fileFormat specifies the type of templating engine to engage.

template specifies the binary document/presentation template to execute on.

data specifies the data to apply on the template document

trimPageBreaks specifies whether to remove or keep blank page breaks in the end of the document.

removeContentControls (word only) specifies whether to remove or keep content controls after applying data in the document.

enableReadBack (word only) stores the input data in a CutomXml file inside the document and keeps bound content controls in order to retrieve the input data updated with manual changes to the document.