Skip to content

feat(whatsapp-flows): save files customers upload in flows - #1650

Merged
viethung0o0 merged 1 commit into
mainfrom
feat/whatsapp-flow-media-uploads
Nov 4, 2026
Merged

viethung0o0 merged 1 commit into
mainfrom
feat/whatsapp-flow-media-uploads

Conversation

@viethung0o0

@viethung0o0 viethung0o0 commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Files customers upload in a WhatsApp Flow (photo and document pickers) are downloaded when the response arrives and kept as message attachments, since Meta does not say how long it keeps them.
  • WhatsApp Flow steps and template FLOW buttons can save the file links to a text custom field, either all links or only the first one. A field is left as it was when no file was kept.
  • In the inbox, a Flow response is one compact card (text, photo previews, file count, files not saved) that opens the full answers; the answers dialog and the flow-response API show each file as stored, failed (with a reason) or not saved.
  • Downloads follow Meta's documented steps and limits (10 files and 100 MiB per response, 25 MiB per file, the documented type list, a fresh URL on 404), are capped per worker process, and one failed file never drops the rest of the response.
  • Media is requested only for the receiving number (phone_number_id), and each file is stored under a random UUID key, so its public link cannot be guessed.
  • DatePicker dates are saved in the form date and datetime fields accept (including the millisecond timestamp of Flow JSON before 5.0, as the contact's local day), CalendarPicker ranges as start - end, and the id of the message a Flow response answers is kept.
  • Flow files are not treated as something the contact sent: media keywords, AI attachments and last user input behave as before.
  • Mini Apps published to WhatsApp are checked against the 10-file limit. Details are in docs/whatsapp-flow-media-uploads.md.

Validation

  • pnpm lint
  • check-types for all packages (pre-commit)
  • vitest for builder, worker, whatsapp, business, sdk, utils, mini-app and flow-config
  • Local end-to-end run with simulated webhooks and a stubbed media API: storage, inbox view, limits, retries, redelivery and custom-field mapping
  • Not yet tried with a real Flow on a test WhatsApp number

@github-actions github-actions Bot added the feature New feature or request label Nov 4, 2026
@viethung0o0
viethung0o0 force-pushed the feat/whatsapp-flow-media-uploads branch 6 times, most recently from c5c54c2 to b41b423 Compare November 4, 2026 17:42
- Download PhotoPicker / DocumentPicker answers from a Flow response with
  the media id, store them as message attachments, and record each file as
  stored or failed with a reason
- Follow Meta's download steps and limits: 10 files and 100 MiB per
  response, 25 MiB per file, the documented type list, a fresh URL on 404
- Ask Meta only for media uploaded on the receiving number, and store each
  file under a random key so its public link cannot be guessed
- Show a Flow response in the inbox as one compact card (text, photo
  previews, file count, files not saved) that opens the full answers
- Return uploaded files from the flow-response API
- Save file links to text custom fields from Flow steps and template Flow
  buttons, with an all-links or first-link format
- Save DatePicker dates in the form date and datetime fields accept, and
  CalendarPicker ranges as start - end
- Keep the id of the message a Flow response answers
- Keep Flow files out of contact input, so media keywords, AI attachments
  and last user input behave as before
- Validate the 10-file limit when publishing a Mini App as a WhatsApp Flow
@viethung0o0
viethung0o0 force-pushed the feat/whatsapp-flow-media-uploads branch from b41b423 to 2542a3c Compare November 4, 2026 17:50
@viethung0o0
viethung0o0 marked this pull request as ready for review November 4, 2026 23:09
@viethung0o0
viethung0o0 merged commit 03c4ac6 into main Nov 4, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants