Skip to content

Flow actions

Sliick Docs adds three actions to Flow Builder, under the Sliick Docs category. You can use them in record-triggered, scheduled and screen Flows.

The person (or automated user) the Flow runs as needs the Sliick_Docs_Automation permission set.

A failed action does not stop your Flow. Each action hands back Success and Error Message. When something goes wrong, Success is false and Error Message says why, so you can add a Decision and handle it.

Wherever an action asks for a template or bundle, you can give either:

  • the Template Id (or Bundle Id): the record Id, or
  • the Template External Id (or Bundle External Id): the value in the template’s or bundle’s External Id field.

Give one or the other, not both. Use the External Id if the Flow will move from a sandbox to production: record Ids change between orgs, External Ids do not.

Makes one document for one record. The Flow waits for the result.

The Generate Sliick Doc action in Flow Builder, with a template External Id and the triggering record's Id filled in

InputRequiredWhat to give it
Template Id or Template External IdOne of themA published template.
Record IdYesThe record to make the document for. It must be the type of record the template is built for.
Output FormatNoPDF (default) or Word. The template must make that format.

What you get back: Job Id, Content Document Id (the saved file), Success, Error Message.

A very long document can stop the whole Flow. This action and Generate Sliick Bundle make the document while the Flow waits. If it needs more processing time or memory than Salesforce allows, Salesforce stops the Flow with its own error, and in a record-triggered Flow the record is not saved either. For long documents, use Generate Sliick Docs (Bulk).

With premium high-volume rendering on, a PDF from this action is made in the background. Success comes back true once the request is accepted, but Content Document Id is empty, because the file arrives a little later. Do not build later Flow steps that need the file straight away. See Generation at scale.

Makes documents for many records in the background. The action hands back the batch straight away and does not wait for the documents. You can watch the run on the Doc Batches tab.

The Generate Sliick Docs (Bulk) action in Flow Builder with a template External Id, a collection of record Ids, a job label, output mode and sort order filled in

InputRequiredWhat to give it
Template Id or Template External IdOne template, or one bundleThe template to use.
Bundle Id or Bundle External IdOne template, or one bundleUse instead of a template to run a bundle.
Record IdsOne way to pick recordsA collection of record Ids, up to about 6,000. A longer list returns “STRING_TOO_LONG: Query Condition”.
Query ConditionOne way to pick recordsA filter, for example Industry = 'Technology'. If a value contains an apostrophe, write it as O\'Brien.
Report IdOne way to pick recordsA tabular Salesforce report of up to 2,000 rows. Its records must be the type the template is built for. A report with more rows returns Success false, and Error Message usually gives its row count: add a filter to the report, or split it into smaller reports.
Job LabelNoA name for the run. If left blank, it is called Flow Run @ followed by the date and time.
Batch SizeNo1 to 200. Default 1.
Output ModeNoIndividual (default), Combined or Both.
Output FormatNoPDF (default) or Word. Word needs Individual output mode.
Sort OrderNoUp to three fields, each with ASC or DESC, for example Name ASC, CreatedDate DESC. Sets the page order of a combined PDF.
Create ZIP When FinishedNoTrue to put the batch’s documents in one ZIP saved on the batch. Default false. Needs Individual or Both output mode. See Build a Flow that delivers the ZIP. New in 3.5.
Generate For All RecordsNoTrue to generate for every record the running user can see when no Record Ids, Query Condition or Report Id is given. It never widens a selection: when you give one, only those records run. Default false. New in 4.1.1.

To pick records, give Record Ids, Query Condition, Report Id, or a combination:

  • Record Ids and Query Condition together: only records that match both are included.
  • Report Id and Record Ids together: the IDs are added to the report’s records, and a record in both counts once. Together they can name up to 2,000 records.
  • Query Condition with a report: only the records that also match the condition run.

Choose the records, or ask for all of them. If a call gives no Record Ids, no Query Condition and no Report Id, it makes no batch: Success is false and Error Message says “Choose which records to generate for: pass record IDs, a condition or a report. To generate for every record, turn on Generate For All Records.” An empty collection or a blank value counts as not given. So check that the Flow variable you pass is filled in, or, if you really mean every record, set Generate For All Records to {!$GlobalConstant.True}.

What you get back: Batch Id, Success, Error Message.

Pass the whole collection once. Do not put this action inside a Loop. Inside a Loop you get one batch per record instead of one batch for the whole set, which is almost never what you want.

With premium high-volume rendering on, a PDF batch from this action is made on the premium service. The action and what it hands back work the same way. The batch can hold up to 100,000 documents, sets its own Batch Size, and its files arrive as they are ready. See Premium batches.

The documents are not in what the action hands back. They arrive on the batch and its generations, so you collect them with a second, record-triggered Flow on Doc Batch. What that Flow waits for depends on what you want:

  • The combined PDF (Combined or Both): start when Status changes to Succeeded or Partial Success. The batch’s Combined File Id (sliick__Combined_File_Id__c) is the file’s Id. If it is blank on a finished batch, the combine did not work, and Error Summary says why.
  • Each record’s file (Individual or Both): start when Status changes to Succeeded or Partial Success. Use Get Records on Generations (sliick__Job__c) where Doc Batch (sliick__Doc_Batch__c) is your batch Id and Status (sliick__Status__c) is Succeeded. On each row, Artifact File Id (sliick__Artifact_File_Id__c) is the file and Root Record Id is the record it was made for.
  • One ZIP of the files (Individual or Both, with Create ZIP When Finished on): start when ZIP Status changes, not Status. See Build a Flow that delivers the ZIP.

If your documents are saved to Sliick Files, Artifact File Id holds a Sliick Files reference, not a Salesforce file Id, so a link built from it will not open. Download those files from the batch or the record instead.

You need two Flows. The first starts the batch and asks for the ZIP. The second runs when the ZIP is ready and does something with it. The ZIP is made after the batch finishes, so a Flow that starts on the batch’s Status would find no file yet.

If your documents are saved to Sliick Files, you can’t use Create ZIP When Finished. With it on, the action returns Success false and makes no documents. Leave it off and use Download all as ZIP on the Doc Batches tab.

  1. Add Generate Sliick Docs (Bulk) to your Flow, and choose the template and records as usual.
  2. Set Output Mode to Individual or Both. With Combined, the action returns Success false and makes no batch, because there is no file per record to put in a ZIP.
  3. Set Create ZIP When Finished to {!$GlobalConstant.True}.
  4. Fill in Job Label. The ZIP is named after it: a label of November statements gives November statements - All.zip.
  5. Add a Decision on Success. If it is false, Error Message says why.
  1. Create a Record-Triggered Flow on Doc Batch (sliick__Doc_Batch__c), set to run when A record is updated.
  2. Under Set Entry Conditions, choose Any Condition Is Met (OR) and add three conditions on ZIP Status (sliick__Zip_Status__c): Equals Ready, Equals Failed, and Equals Not Made.
  3. Under When to Run the Flow for Updated Records, choose Only when a record is updated to meet the condition requirements, so it runs once per batch.
  4. Under Optimize the Flow for, choose Actions and Related Records, tick Include a Run Asynchronously path, and build the remaining steps on that path.
  5. Add a Decision with an outcome for ZIP Status equals Ready. Let the default outcome handle the other two.

On the Ready path, ZIP File Id (sliick__Zip_File_Id__c) is the file’s ContentDocument Id. Add the steps for what you want to do with it:

To email the ZIP:

  1. Add Get Records on Content Version where ContentDocumentId equals {!$Record.sliick__Zip_File_Id__c} and IsLatest equals true. Keep the first record only.
  2. Add Send Email, and put that Content Version’s Id in Attachment ID. Send Email does not accept the ZIP File Id itself. Set the rest as described in Email generated documents. Send a test with your largest run first, because a ZIP can be bigger than an email can carry.

To put the ZIP on a record, so people who can open that record can open the file:

  1. Find the record you want, for example with Get Records.
  2. Add Create Records on Content Document Link with these fields: ContentDocumentId set to {!$Record.sliick__Zip_File_Id__c}, LinkedEntityId set to the record’s Id, ShareType set to V and Visibility set to AllUsers.

On the default path, tell someone what happened, for example by emailing your admin. ZIP Status says which case you are in:

ZIP StatusWhat it means
FailedThe ZIP could not be made. Error Summary (sliick__Error_Summary__c) says why and what to do.
Not MadeThere was nothing to put in a ZIP, or someone stopped the batch. Status can still read Succeeded, so check ZIP Status.

The person who started the batch also gets one notification saying whether the ZIP is ready.

Flow 2 runs for every batch in your org that asks for a ZIP. If you have more than one, tell them apart: choose Custom Condition Logic Is Met, enter (1 OR 2 OR 3) AND 4, and add a fourth condition that Label (sliick__Label__c) contains a word from your Job Label.

  • It holds one file for each document that was made. A Partial Success batch still gets a ZIP of the documents that succeeded.
  • With Both, the combined PDF is not in the ZIP. It stays a separate file in Combined File Id.
  • Documents with the same file name are all kept, as Statement.pdf, Statement (2).pdf and so on.
  • It is saved on the batch, so people who can see the batch can open it: the person who started it, and your Sliick Docs Admins and Template Authors. To share it wider, put it on a record or email it.
  • Large runs may not fit in one ZIP, and this includes premium batches. ZIP Status then shows Failed. Test with your largest run, and split the records into smaller batches if you need to.
  • If the template deletes documents after a set time, the ZIP is deleted once the batch’s documents are gone.

Without Create ZIP When Finished, ZIP File Id stays blank until someone clicks Download all as ZIP on the Doc Batches tab.

Makes one combined document from several templates, for one record. The Flow waits for the result.

InputRequiredWhat to give it
Bundle Id or Bundle External IdOne of themA published bundle.
Record IdYesThe record to make the document for. It must be the type of record the bundle is built for.
Output FormatNoPDF (default) or Word.

What you get back: Job Id, Content Document Id (the combined file), Success, Error Message.

A bundle made from a Flow is put together inside the Flow’s own transaction. A very large bundle can stop the Flow. For very large bundles, generate from the record page or use Generate Sliick Docs (Bulk) with the bundle.

With premium high-volume rendering on, a combined PDF bundle from this action is made on the premium service in the background, and the size limit above does not apply. Success comes back true once the request is accepted, but Content Document Id is empty, because the file arrives a little later. Read the file from the generation (the Job Id) once it has finished. There is no limit on premium bundles in one Flow run (from 3.5). For many records, use Generate Sliick Docs (Bulk) with the bundle. Word bundles are still made inside Salesforce and work as described above.

Download-only templates do not work in a Flow

Section titled “Download-only templates do not work in a Flow”

Some templates are set to give the person a download instead of saving the file. A Flow has no one to hand a download to, so it refuses these templates before starting, with a message naming the setting to change.

The exception: if your organisation uses premium high-volume rendering, those documents are always saved, so the Flow works.

A Word file from a Word-file template with many large pictures can be too big to make while the Flow waits, and Salesforce stops the Flow with its own memory error. Ask for PDF instead, or make the pictures smaller.

On a screen Flow, the Sliick Docs Generator (Screen) component makes such a file in the background when the template’s Force Async Render box is ticked and the destination is Save: the file is saved to the record when it is ready, and the component’s Outcome is QUEUED. Download and Both are always made straight away.

  1. Make a document when a record reaches a stage (record-triggered Flow). Start the Flow when an Opportunity closes (IsClosed equals true), then call Generate Sliick Doc with your template and the Opportunity’s Id. Every closed Opportunity gets its closeout PDF. Add an email Flow to send it to the customer too.
  2. Send statements overnight (scheduled Flow). Every day at 2am, get the Accounts updated yesterday, then call Generate Sliick Docs (Bulk) once with that collection.
  3. Let people start their own bulk run (screen Flow). Show a template picker and a filter or report picker, call Generate Sliick Docs (Bulk), then show the Batch Id with a link to the Doc Batches tab so they can watch progress.