Automating with Flow and Agentforce
12 minutes read

Before you start

Thirteen invocable actions ship with the package, available in Flow Builder under the Dropbox action category. The same thirteen are available as Agentforce agent actions. They are the same actions, not two sets.

Each action runs as the user executing the Flow or agent, using that user's own Dropbox connection. Before any action will succeed:

  • The running user needs the Dropbox Standard or Dropbox Admin permission set.
  • The running user must have connected their own Dropbox account.
  • The org must have completed workspace setup.

If any of these are missing the action returns success = false with an explanatory message. Start with Check Dropbox Connection if you want to fail gracefully.

Three of these actions are the only route to their functionality. Move, copy and item-level rename have no equivalent in the Dropbox File Manager, so Flow is how you expose them.

Adding an action to a Flow

  1. In Flow Builder, add an Action element.
  2. Set the category filter to Dropbox.
  3. Choose the action.
  4. Map your inputs. For record-scoped actions, pass the record ID from a Flow variable or $Record.Id.
  5. Store the outputs in variables if you need to branch on the result.

Common conventions

FieldMeaning
recordIdThe Salesforce record whose Dropbox folder the action targets. Works with any object that has a Name field.
subPath / destSubPathOptional subfolder inside the record folder. Blank means the folder root.
successTrue when the action completed. Check this before using other outputs.
messageHuman readable result or error detail.

Two actions break these conventions. Check Dropbox Connection has no success output, use isConnected. List Files for Record reports failures in errorMessage, not message.

Action reference

Check Dropbox Connection

Confirms the running user has a working connection and returns the account details.

Inputs

FieldTypeRequiredNotes
placeholderTextNoNot used. Leave empty. Present only because Flow requires at least one input.

Outputs

FieldTypeNotes
isConnectedBooleanUse this instead of success. There is no success output.
accountEmailTextEmail on the connected Dropbox account.
accountNameTextDisplay name on the connected account.
messageTextResult detail.

Create Folder for Record

Creates one or more folders under the record's folder. Also the way to guarantee the record folder exists before other actions run.

Inputs

FieldTypeRequiredNotes
recordIdRecord IDYes
folderNameTextNoFolder path or paths. Separate siblings with a semicolon or comma. Use a forward slash to nest. Blank creates or confirms only the record root folder.
parentPathTextNoOptional parent folder beneath which the names are created.

A folderName value of finance/reporting;marketing;legal/myfolder/subfolder/other;operations creates four top-level folders, two with nested subfolders.

Outputs

FieldTypeNotes
successBoolean
folderPathTextFull Dropbox path of the created folder.
folderIdTextDropbox folder identifier.
subfoldersCreatedNumberSibling entries created or already present.
messageText

Limitation: folder names containing a comma or semicolon are not supported, because those are the sibling separators.

Upload File to Record

Inputs

FieldTypeRequiredNotes
recordIdRecord IDYes
fileNameTextYesName in Dropbox, including extension.
fileContentTextYesBase64 encoded content.
subPathTextNoOptional subfolder.

Outputs

FieldTypeNotes
successBoolean
filePathTextFull Dropbox path of the uploaded file.
fileIdTextDropbox file identifier.
messageText

Content passes as base64 inside the Flow transaction, so this suits small and moderate files. The 150 MB chunked upload path exists only in the file manager component.

List Files for Record

Inputs

FieldTypeRequiredNotes
recordIdRecord IDYes
subPathTextNoOptional subfolder to list instead of the root.

Outputs

FieldTypeNotes
successBoolean
filesJsonTextJSON array. Each entry has the keys id, name, path, isFolder, size, modified.
fileCountNumberEntries returned.
folderPathTextPath that was listed.
errorMessageTextThis action uses errorMessage, not message.

Delete File from Record

A real Dropbox delete. Treat accordingly.

Inputs

FieldTypeRequiredNotes
recordIdRecord IDYes
filePathTextYesPath or Dropbox ID of the file.

Outputs: success, message.

Rename File or Folder for Record

Inputs

FieldTypeRequiredNotes
recordIdRecord IDYes
currentNameTextYesCurrent name of the item.
newNameTextYesNew name.

Outputs: success, newName, message.

This renames an item inside the folder. Renaming the record's root folder is done from the file manager instead.

Move File or Folder to Record Folder

Inputs

FieldTypeRequiredNotes
recordIdRecord IDYesThe destination record.
itemNameTextYesItem to move.
destSubPathTextNoOptional subfolder in the destination.
sourceRecordIdRecord IDNoRecord moved from. Defaults to the destination record.

Outputs: success, itemName, message.

Copy File or Folder to Record Folder

Same shape as Move, but leaves the source in place.

Inputs

FieldTypeRequiredNotes
recordIdRecord IDYesThe destination record.
itemNameTextYesItem to copy.
destSubPathTextNoOptional subfolder in the destination.
sourceRecordIdRecord IDNoRecord copied from. Defaults to the destination record.

Outputs: success, itemName, message.

Get Shareable Link

Inputs: recordId (required), filePath (required, path or Dropbox ID).

Outputs

FieldTypeNotes
successBoolean
shareUrlTextPublic shareable link. Does not expire.
messageText

Get Temporary Download Link

Inputs: recordId (required), filePath (required).

Outputs

FieldTypeNotes
successBoolean
downloadUrlTextDirect download URL, valid for 4 hours. Do not store it on a record for later use.
messageText

Get Folder Share Link

Inputs: recordId (required).

Outputs: success, folderUrl, message.

Search Files in Dropbox

Inputs

FieldTypeRequiredNotes
queryTextYesText to search for.
searchPathTextNoOptional folder path to limit scope.

Outputs

FieldTypeNotes
successBoolean
resultsJsonTextJSON array. Keys: id, name, path, isFolder.
resultCountNumberMatches found.
messageText

Not scoped to a record. It searches the connected user's whole Dropbox, so results can include files outside the Salesforce workspace unless you set searchPath.

Get Dropbox Storage Usage

Inputs: placeholder (not used, leave empty).

Outputs

FieldTypeNotes
successBoolean
usedBytesNumberSpace used in bytes.
totalBytesNumberTotal allocation in bytes.
usedFormattedTextHuman readable used space.
totalFormattedTextHuman readable total.
percentUsedNumberPercentage consumed.
messageText

Using the same actions with Agentforce

Every action above is available as an agent action. Grouped by intent:

PurposeActions
FindSearch Files in Dropbox, List Files for Record
RetrieveGet Shareable Link, Get Temporary Download Link, Get Folder Share Link
AddUpload File to Record, Create Folder for Record
OrganiseMove, Copy, Rename
RemoveDelete File from Record
Check stateCheck Dropbox Connection, Get Dropbox Storage Usage

Requests an agent can handle well: find the signed contract for Acme Corp and send me a link; create Contracts and Invoices folders on this Opportunity; what files do we have on this Case; copy the proposal from the Account folder into this Opportunity; how much Dropbox storage are we using.

The pattern that works is search plus act. Find the file, then produce a link to it. These actions do not read file contents, so do not ask an agent to reason about what is inside a document.

Setting it up

  1. In Agent Builder, open or create the topic, for example Document Management.
  2. Add the actions you want.
  3. Write topic instructions describing when each applies. The packaged action descriptions are a starting point, not a substitute.
  4. Test with realistic phrasing, including requests that should not trigger a Dropbox action.

Be selective. Adding all thirteen to one topic makes action selection less reliable. Group by intent and leave out the destructive ones unless you need them.

Agent-specific cautions

Delete is irreversible from Salesforce. If you give an agent the delete action, require explicit confirmation in the topic instructions, and accept that the confirmation is only as reliable as the model's adherence to them. Most customers are better served leaving it out.

Share links do not expire. If an agent hands one out, it keeps working. For anything sensitive prefer the temporary link.

Search is unscoped. An agent asked a broad question may surface files from outside the workspace. Constrain searchPath where the topic allows.

The connection constraint decides everything. There is no org-level service connection. An employee-facing agent running as the user works naturally. An autonomous or scheduled agent running as an integration user requires that user to have connected a Dropbox account of their own, and realistically requires a Team Folder workspace so that connection can see the team's files. Start any Dropbox topic with Check Dropbox Connection so the agent can tell the user to connect rather than reporting an opaque failure.

Things to watch for

  • Check Dropbox Connection has no success output. Branch on isConnected.
  • List Files for Record uses errorMessage. The other twelve use message. Uniform error handling will silently miss list failures.
  • Placeholder inputs on Check Connection and Get Storage are unused. Leave them blank.
  • Temporary links expire after 4 hours. Use Get Shareable Link for anything durable.
  • Move, Copy and Rename are Flow-only. No file list equivalent.
  • Actions run as the current user. A Flow in system context still needs the running user's Dropbox connection. Scheduled and automated Flows fail if the automation user has never connected.

Worked example: file a signed contract on Opportunity close

  1. Record-triggered Flow on Opportunity, condition StageName equals Closed Won.
  2. Check Dropbox Connection. If isConnected is false, create a task for the owner and exit.
  3. Create Folder for Record with folderName set to Contracts;Invoices.
  4. Copy File or Folder to Record Folder with sourceRecordId set to the related Account and destSubPath set to Contracts.
  5. Get Folder Share Link and write folderUrl to a URL field on the Opportunity.
In this article