Register your interest: Tag @Cody, get an agent
BlogResources

Box and CodeWords: automating document workflows

Reacting to uploads, folder structures created per client or matter, metadata that makes files findable, retention, and the permission model that makes Box worth using in the first place.

Rithul PalazhiRithul Palazhi11 min read

Summarize with AI

Box and CodeWords: automating document workflows
On this page

Organizations usually choose Box for the governance rather than the storage: retention policies, granular permissions, audit trails, and classification that satisfies somebody's compliance requirement. That context should shape any automation you build around it, because an automation that undermines the permission model has removed the reason you are paying for Box.

The work worth automating is the repetitive structure around documents: creating the folders, applying the metadata, moving things through states, and chasing what has not arrived.

What we'll cover

What Box is actually for

Worth stating, because it determines what good automation looks like here.

Controlled access. Permissions at folder and file level, with collaboration roles that distinguish viewing, editing, and uploading. Automations should work within this rather than around it.

Retention and legal hold. Policies that govern how long things live and prevent deletion when required. An automation that deletes files needs to understand that some cannot be deleted, and that this is a feature.

Audit trail. A record of who did what. An automation acting as a service account will appear in that trail as the service account, which is worth thinking about before it acts on behalf of people.

Classification and metadata. Structured attributes on files, which is what makes a large document estate searchable rather than merely stored.

If none of those matter to you, a simpler storage product would do. Since they presumably do, the automation should reinforce them.

What the Box API reaches

Files and folders can be listed, created, copied, moved, renamed, and deleted, with a tree structure that behaves the way people expect, unlike object storage.

Uploads and downloads support both direct and chunked transfer for large files.

Metadata templates can be applied to files and folders and their values read and written, which is the mechanism behind findability.

Collaborations grant access to users and groups at a given role, which is how permissions are set programmatically.

Shared links can be created with expiry, password, and access level, for sharing outside your organization.

Tasks can be assigned to people on a file, with due dates, which is a genuinely useful and underused capability for approval flows.

Retention policies and legal holds are readable, so an automation can know when it must not act.

Webhooks fire on file and folder events, which is what lets automation react.

Connecting it to CodeWords

CodeWords connects to more than 3,000 integrations, and the connection is made once and reused.

  1. Open CodeWords and start a new automation.
  2. Describe what should happen in plain language to Cody, the automation builder: which folder, what arrives, and what should happen to it.
  3. Authorize the connection, preferring a service account scoped to the folders involved over credentials belonging to a person.
  4. Describe the exceptions: a file that fails validation, a folder that already exists, a document under legal hold.
  5. Test in a folder created for the purpose before pointing anything at real client material.

You describe the outcome; Cody builds it, connects it, and deploys it. The free plan covers light use, with Pro at $39 per month and Business at $100 per month as usage grows; details are on the pricing page.

Eight automations worth building

Folder structure per client or matter. When a deal closes or a case opens, create the standard structure from a template, name it by your convention, apply metadata, and grant access to the right group. The most valuable automation here, because it happens repeatedly and drifts when done by hand.

Intake processing. A document arrives, gets validated, has its type identified, gets metadata applied, and is filed into the right folder. Filing by hand is where documents go missing.

Approval routing with tasks. Assign a task to the right person with a due date when a document reaches a folder, and chase it when it is overdue. Box's tasks are better than most people realise and almost nobody automates them.

Missing document chasing. Compare what should be present against what is, and chase whoever owes you the gap. Every onboarding, every case, every audit has a checklist and nobody enjoys tracking it.

External sharing with expiry. Generate shared links with appropriate expiry and access level when something needs to go outside, and record what was shared with whom.

Retention support. Report documents approaching a retention boundary so a person can decide, rather than acting automatically on anything with compliance consequences.

Metadata backfill. Apply structured attributes to documents that predate your template, using what can be inferred from their location and content, flagged as inferred rather than confirmed.

Access review reporting. Who has access to what, particularly external collaborators, reported periodically. Access grants accumulate and nobody revokes them.

Permissions, which you must not undermine

The clearest way to ruin a Box implementation is to automate around its access model.

Never grant broader access to make an automation simpler. If the automation cannot see a folder, the correct fix is a scoped grant to that folder, not widening it.

Use a service account with explicit collaborations, not a person's credentials. A person's account carries their access, which is far more than the automation needs, and it breaks when they leave.

Grant the minimum role. Box distinguishes viewer, editor, uploader and more. An automation that files documents needs upload rights, not editing rights over everything in the folder.

Be careful with inherited permissions. Creating a subfolder inherits from its parent, so an automation building structures needs to understand what the parent grants before assuming anything about the child.

Log what access was granted and why. The audit trail shows what happened; your log should show the reason. When an access review asks why an external collaborator has access to a client folder, that answer should exist.

Treat shared links as access. A link without expiry is permanent access for anyone who has it. Automations creating links should set expiry deliberately every time.

Metadata that makes files findable

Decide the template before automating anything. A handful of attributes everybody agrees on beats a rich schema nobody populates.

Capture what you cannot infer later. Client, matter, document type, date of the document rather than date of upload. Reconstructing these from filenames afterwards is the work you are trying to avoid.

Use enumerated values rather than free text for anything you will filter on, since free text accumulates spelling variants that searches miss silently.

Mark inferred values as inferred. A document type guessed by an automation and one confirmed by a person are different things and should be distinguishable.

Apply it at intake. Metadata added later is metadata added never. The moment a file arrives is the only reliable point to capture it.

Building it so it survives

Make it safe to run twice. Webhooks retry. Check whether a folder exists before creating it, or you will produce two identically named client folders and a confusing afternoon.

Reference by ID, not by path. Folder names change. An automation navigating by path breaks the first time somebody renames something; one holding IDs does not.

Respect legal hold and retention. Check before deleting or moving anything, and treat a refusal as correct behaviour rather than an error.

Report the outcome. A daily line with counts processed and exceptions raised makes silence meaningful.

Never bulk-delete without a record. Log what was removed, and prefer moving to an archive folder over deleting where the policy permits.

Limits worth knowing about

Rate limits apply per user, so bulk operations need pacing, and the API signals when to back off.

Large uploads need chunked transfer above a size threshold, which an automation handling arbitrary files must account for.

Folder item counts have practical limits, so a single folder accumulating everything becomes slow to list. Design structures that branch.

Metadata templates are defined at the enterprise level and must exist before values can be written.

Deleted items go to trash with a retention period rather than disappearing, which is usually helpful and means a delete does not immediately free the quota.

What to build first

The folder structure automation for whichever repeated thing you create most: clients, matters, projects. It runs often, the inconsistency of doing it by hand is already annoying somebody, and it forces you to settle the naming convention and the permission model early, which everything else then inherits.

Two habits make the difference. Run it into a test folder for a cycle and compare against what a person would have created. And have it report what it built, because a structure automation that quietly fails is discovered when somebody cannot find a document.

Frequently asked questions

Should the automation use a service account?

Yes. A person's credentials carry their whole access footprint and stop working when they leave, and every action appears in the audit trail as them. A service account with explicit collaborations on the folders it needs is both safer and clearer in the audit trail.

Can an automation delete documents?

Technically, and it should be rare and deliberate. Retention policies and legal holds exist precisely to prevent deletion in some cases, and an automation must check rather than assume. Prefer moving to an archive folder, and always log what was removed.

How do I stop the automation creating duplicate folders?

Check for an existing folder by name within the parent before creating, and use a naming convention containing something unique such as a client or matter identifier. Retried webhooks are the usual cause of duplicates.

Why reference folders by ID rather than path?

Because names change and paths break. A folder renamed by a user silently breaks every automation navigating to it by path, whereas IDs are stable across renames and moves.

Can I automate external sharing?

Yes, with shared links that have an expiry and an appropriate access level, and with a record of what was shared with whom. The thing to avoid is creating links without expiry, which is permanent access to anybody who ever receives the URL.

They cannot be deleted or, in some configurations, modified, and that is the system working. Your automation should check for holds before acting and treat a refusal as expected, reporting it rather than retrying.

How much metadata is too much?

When people stop filling it in, which happens faster than expected. A handful of attributes everybody agrees on and an automation reliably applies is worth far more than a rich schema that is half empty and therefore untrustworthy for searching.

Can it apply retention policies?

It can read them and should generally not apply them, since retention has compliance consequences and belongs with whoever owns that policy. The useful automation reports documents approaching a boundary so a person can decide, which is genuinely helpful without taking on the liability.

How do I handle documents that arrive by email?

Watch the mailbox, extract the attachments, validate them, apply metadata, and file them. This is one of the most common intake paths in professional services and it is almost always done by hand, which is why documents end up in somebody's inbox rather than in Box.

How do I structure folders so automation stays simple?

Shallow, predictable, and named by a convention containing a stable identifier. Deep hierarchies mean an automation navigating several levels, each of which somebody may rename. Two or three levels with a client or matter reference in the name handles nearly every professional services case.

Automation, for anything routine, because it will set an expiry every time and a person will not. The links people create by hand without expiry are how documents remain reachable years after the engagement ended.

Get started today

Your first workflow is free to build.

Describe what you need. Cody handles the build, the connections, and the deployment.