Use QuoteCloud in a Flow
Seven actions appear in the QuoteCloud category in Flow Builder. They work on Opportunities, and need the QC Use Flow Actions permission, which is included in QC User and QC Admin. Actions that change something also need edit access to the record.
| Action | Apex class | Needs |
|---|---|---|
| Create Draft | QcFlowCreateDraftAction | Opportunity, active template configuration, idempotency key |
| Create and Send | QcFlowCreateAndSendAction | Opportunity, active template configuration, idempotency key |
| Link Existing Document | QcFlowLinkExistingAction | Opportunity, eligible QuoteCloud document ID, idempotency key |
| Unlink Document | QcFlowUnlinkAction | Document, Opportunity, fresh confirmation token, idempotency key |
| Refresh Draft Data | QcFlowRefreshDraftDataAction | Document, Opportunity, idempotency key |
| Resync Document | QcFlowResyncAction | Document, Opportunity, idempotency key |
| Retrieve Document State | QcFlowRetrieveStateAction | Opportunity, plus a document ID, an outbox job ID or both |
Avoid duplicates
Every action that changes something needs a stable idempotencyKey. If the same key comes back, the action returns IDEMPOTENT_REPLAY and doesn't send a second command. Build the key from something that only changes when you really want a new document:
Opportunity.Id & ':approved:' & TEXT(Opportunity.Approval_Version__c)
Check the result
A create result means the work was accepted, not that it's finished. Branch on success first, then on completed. Save outboxJobId, then use Retrieve Document State to read jobStatus and the jobOutcome fields.
Expected failures don't fault the Flow. They return success as false, with code, message, faultDetail and retryable.
Limits
Create actions take up to 5 inputs in a transaction. Above that you get TRANSACTION_CHUNK_REQUIRED, and it's safe to run again with the same keys. A retryable failure is tried again with the same key, up to 5 attempts.
Unlink safely
Run Retrieve Document State first and check unlinkEligible, then pass unlinkConfirmationToken to Unlink Document. If you get STALE_CONFIRMATION, retrieve the state again.
Start from the example
The package includes an inactive Flow, QuoteCloud_Create_And_Send_Example. Clone it and supply recordId, templateConfigId and idempotencyKey.