{"id":447,"date":"2021-02-18T15:14:56","date_gmt":"2021-02-18T15:14:56","guid":{"rendered":"http:\/\/167.71.55.215\/?page_id=447"},"modified":"2023-03-07T09:33:48","modified_gmt":"2023-03-07T09:33:48","slug":"custom-pipelines","status":"publish","type":"page","link":"https:\/\/info.documotor.com\/?page_id=447","title":{"rendered":"Custom Pipelines"},"content":{"rendered":"\n<p>Pipeline templates are used for the flexibility of combining procedures not covered by the graphical UI.<\/p>\n\n\n\n<p>A pipeline template consist of a yaml definition of processors with input\/output defined for each step.<\/p>\n\n\n\n<p>The output of pipelines can be stored by using the output syntax <code>$(outputName)<\/code> and then referenced in the subsequent processors as input.<\/p>\n\n\n\n<p>Input parameters can either be literals or references defined in the pipeline definition.<\/p>\n\n\n\n<h2>DocumentToHtml<\/h2>\n\n\n\n<p>Converts a document to a HTML representation. Currently Word only.<\/p>\n\n\n\n<p>Returns a HTML document as a text string.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"yaml\" class=\"language-yaml\">- !DocumentToHtml\n  inputs:\n    fileFormat: <strong>docx<\/strong>\n    data: <strong>document to convert<\/strong>\n  output: $(<strong>outputName<\/strong>) <\/code><\/pre>\n\n\n\n<p><strong>fileFormat <\/strong>specifies the input format.<\/p>\n\n\n\n<p><strong>data <\/strong>specifies the binary document to convert.<\/p>\n\n\n\n<h2>DocumentToPlainText<\/h2>\n\n\n\n<p>Converts a document to a plain text representation. Currently Word only.<\/p>\n\n\n\n<p>Returns a plain text string.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"yaml\" class=\"language-yaml\">- !DocumentToPlainText\n  inputs:\n    fileFormat: <strong>docx<\/strong>\n    data: <strong>document to convert<\/strong>\n  output: $(<strong>outputName<\/strong>) <\/code><\/pre>\n\n\n\n<p><strong>fileFormat <\/strong>specifies the input format.<\/p>\n\n\n\n<p><strong>data <\/strong>specifies the binary document to convert.<\/p>\n\n\n\n<h2>GenerateTemplafy<\/h2>\n\n\n\n<p>Generate a document from a Templafy One template using a service account.<\/p>\n\n\n\n<p>Returns a binary document.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"yaml\" class=\"language-yaml\">- !GenerateTemplafy\n  inputs:\n    token: <strong>token<\/strong>\n    templateId:<strong> templafy template identifier<\/strong>\n    userProfileId: <strong>service account profile id<\/strong>\n    data: <strong>input to the form data bindings<\/strong>\noutput: $(<strong>outputName<\/strong>) <\/code><\/pre>\n\n\n\n<p><strong>token<\/strong> 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.<\/p>\n\n\n\n<p><strong>templateId <\/strong>specifies the unique identifier for a template in Templafy.<\/p>\n\n\n\n<p><strong>userProfileId<\/strong> specifies the service account user profile used for generating the document. Identifier can be acquired by Omnidocs, valid for a single Templafy tenant.<\/p>\n\n\n\n<p><strong>data<\/strong> specifies the data json forwarded as input to the Templafy dynamic template.<\/p>\n\n\n\n<h2>JmesPath<\/h2>\n\n\n\n<p>Perform data transformation beyond the input data transformation.<\/p>\n\n\n\n<p>Returns a json text string.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"yaml\" class=\"language-yaml\">- !JmesPath\n  inputs:\n    json: <strong>json to transform<\/strong>\n    jmes: <strong>data transformation<\/strong>\n  output: $(<strong>outputName<\/strong>) <\/code><\/pre>\n\n\n\n<p><strong>json<\/strong> specifies the data to transform.<\/p>\n\n\n\n<p><strong>jmes <\/strong>specifies the transformation to perform.<\/p>\n\n\n\n<h2>OfficeToPdf<\/h2>\n\n\n\n<p>Converts a binary document\/presentation to a PDF.<\/p>\n\n\n\n<p>Returns binary PDF.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"yaml\" class=\"language-yaml\">- !OfficeToPdf\n  inputs:\n    fileFormat: <strong>docx\/pptx<\/strong>\n    document: <strong>document to convert<\/strong>\n  output: $(<strong>outputName<\/strong>) <\/code><\/pre>\n\n\n\n<p><strong>fileFormat <\/strong>specifies the input format.<\/p>\n\n\n\n<p><strong>document <\/strong>specifies the binary document to convert.<\/p>\n\n\n\n<h2>QueryString<\/h2>\n\n\n\n<p>Read additional data from a custom API query parameter and use it in the pipeline.<\/p>\n\n\n\n<p>Returns the string value of the query parameter.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"yaml\" class=\"language-yaml\">- !QueryString\n  inputs:\n    paramKey: <strong>parameter name<\/strong>\n    defaultValue: <strong>default value<\/strong>\n  output: $(<strong>outputName<\/strong>) <\/code><\/pre>\n\n\n\n<p><strong>paramKey <\/strong>specifies the name of the query parameter to read from in the pipeline.<\/p>\n\n\n\n<p><strong>defaultValue <\/strong>specifies the default value if the parameter is omitted from the request.<\/p>\n\n\n\n<h2>ReadBack<\/h2>\n\n\n\n<p>Provides the ability to read back the original input dataset updated with user changes to the document content controls in Word.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"yaml\" class=\"language-yaml\">- !ReadBack\n  inputs:\n    fileFormat: <strong>docx\/pptx<\/strong>\n    data: <strong>base64 encoded document<\/strong>\noutput: $(<strong>outputName<\/strong>)<\/code><\/pre>\n\n\n\n<p><strong>fileFormat <\/strong>specifies the type of input file.<\/p>\n\n\n\n<p><strong>data<\/strong> specifies the base 64 encoded document. Use body of request $(body).<\/p>\n\n\n\n<h2>Response<\/h2>\n\n\n\n<p>Can be used as a last step of the pipeline to set the return value for the response.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"yaml\" class=\"language-yaml\">- !Response\n  inputs:\n    body: <strong>value<\/strong>\n    mimeType: <strong>mime type<\/strong> <\/code><\/pre>\n\n\n\n<p><strong>body <\/strong>specifies the value to set as the response<\/p>\n\n\n\n<p><strong>mimeType <\/strong>specifies the mime type for the pipeline handler to finalize.<\/p>\n\n\n\n<h2>RunTemplate<\/h2>\n\n\n\n<p>Executes the DocuMotor templating engine on the input document\/presentation template.<\/p>\n\n\n\n<p>Returns the document as binary.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"yaml\" class=\"language-yaml\">- !RunTemplate\n  inputs:\n    fileFormat: <strong>docx\/pptx<\/strong>\n    template: <strong>binary template<\/strong>\n    data: <strong>data to insert<\/strong>\n    trimPageBreaks: <strong>true\/false<\/strong>\n    removeContentControls: <strong>true\/false<\/strong>\n    enableReadBack: <strong>true\/false<\/strong>\n  output: $(<strong>outputName<\/strong>) <\/code><\/pre>\n\n\n\n<p><strong>fileFormat <\/strong>specifies the type of templating engine to engage.<\/p>\n\n\n\n<p><strong>template<\/strong> specifies the binary document\/presentation template to execute on.<\/p>\n\n\n\n<p><strong>data<\/strong> specifies the data to apply on the template document<\/p>\n\n\n\n<p><strong>trimPageBreaks<\/strong> specifies whether to remove or keep blank page breaks in the end of the document.<\/p>\n\n\n\n<p><strong>removeContentControls<\/strong> (word only) specifies whether to remove or keep content controls after applying data in the document.<\/p>\n\n\n\n<p><strong>enableReadBack <\/strong>(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.<\/p>\n\n\n\n<div class=\"wp-container-1 wp-block-buttons\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3160,"menu_order":9,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/447"}],"collection":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/info.documotor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=447"}],"version-history":[{"count":13,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/447\/revisions"}],"predecessor-version":[{"id":3257,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/447\/revisions\/3257"}],"up":[{"embeddable":true,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/3160"}],"wp:attachment":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=447"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}