FlowPrime guides

Marketing: contacts, segments, automated sequences and broadcasts

Marketing keeps a list of contacts with their properties, groups them into segments, mails them automatically when they do something (a sequence: welcome series, onboarding nudge, re-engagement), and sends one-off broadcasts to a segment. Every message goes out from your workspace's own sender, through your workspace's mail providers, using templates stored in Mail. Use it for lifecycle mail driven by what people do. For a plain mailing list with editions, see platform_guide topic=newsletter.

What you can do

Capability How Status
Read or set the sender marketing_get_sender, marketing_set_sender live
Create or update a contact by e-mail marketing_contact_create live
List, search and read contacts marketing_contact_list (search matches email or name), marketing_contact_get, or dashboard (Marketing > Contacts) live
Import contacts in bulk, with a dry run first marketing_contact_import (dryRun=true counts new, updated and left-out rows without writing), or dashboard (Marketing > Contacts > Import CSV) live
Edit a contact's name, external id or properties (null removes a property) marketing_contact_update, or dashboard (the contact's page) live
A contact's sequences and what they sent marketing_contact_activity, or dashboard (the contact's page, with the mail log for that address) live
Segments by contact property or by recent analytics event marketing_segment_create, marketing_segment_list, marketing_segment_get, marketing_segment_evaluate, marketing_segment_delete live
Sequences (manual or triggered by an event) marketing_sequence_create, marketing_sequence_list, marketing_sequence_get, marketing_sequence_delete live
Add a step to a sequence (template, subject, delay) marketing_sequence_add_step live
Remove a sequence's step REST DELETE /api/sequences/{id}/steps/{stepId} live (REST only, no tool)
Start and stop a sequence marketing_sequence_activate, marketing_sequence_pause, or dashboard (the sequence's page: it also previews each email and flags emails missing from Mail) live
Enroll one contact by hand marketing_sequence_enroll live
Fire an event that enrolls a contact in matching sequences marketing_trigger_event live
Stop a contact's sequence when a follow-up event happens (exit condition) triggerConfig "condition":"not", or dashboard (the sequence's page, "Stops when this event arrives") live
Seed the default sequences and the mail templates they send marketing_defaults_seed live
Broadcast to a segment marketing_broadcast_create, marketing_broadcast_send, marketing_broadcast_list, or dashboard (Marketing > Campaigns) live
Create your own mail templates for steps and broadcasts dashboard (Email > Settings, the Templates row of the server marketing sends through: the one with the lowest id, tagged Marketing) dashboard
Unsubscribe or delete a contact, cancel an enrollment REST POST /api/contacts/{id}/unsubscribe, DELETE /api/contacts/{id}, POST /api/sequences/enrollments/{id}/cancel, or dashboard (the contact's page; Stop on a sequence's page) live (no tool)

Before you start

Marketing sends nothing until four things are true. Check them in this order:

  1. Marketing is set up for the workspace. If any marketing tool answers "Marketing is not set up for the workspace", an org admin attaches it with platform_attach_product product=marketing (it is part of the FlowPrime plan), then you call the tool again.

  2. A sender: marketing_get_sender. A null senderEmail means no broadcast or sequence mail goes out. Set one with marketing_set_sender [email protected] fromName="Example".

  3. A mail provider that owns that address. Messages go through your workspace's mail providers; an address no provider lists fails at delivery. mail_status answers delivering when the workspace's mail actually goes out. See platform_guide topic=mail.

  4. The templates. Sequence steps and broadcasts name a mail template by its alias (templateName). The template must exist on the mail server marketing sends through, your workspace's server with the lowest id (dashboard: Email > Settings, the server tagged Marketing, Templates row). marketing_defaults_seed creates the ones the default sequences use; for your own sequences you write them.

Step by step

A welcome series triggered by signup

  1. In the dashboard, create the mail templates, e.g. aliases welcome-1 and welcome-2. Templates use {{variable}} placeholders; unsubscribeUrl is filled in for you.
  2. marketing_sequence_create name="Welcome" triggerType=event triggerConfig='{"eventName":"user_register"}'.
  3. marketing_sequence_add_step id=<id> templateName=welcome-1 subject="Welcome to Example" delayMinutes=0, then marketing_sequence_add_step id=<id> templateName=welcome-2 delayMinutes=4320 (3 days later). Leaving position out appends the step after the last one. Check them with marketing_sequence_get.
  4. marketing_sequence_activate id=<id>. From now on it mails whoever is enrolled.
  5. Test with an address you own: marketing_trigger_event eventName=user_register email=<test address> properties='{"name":"Test"}'. The contact is created or updated and enrolled.
  6. marketing_sequence_get id=<id> and marketing_contact_get to confirm the enrollment.

Sequence triggers and conditions

Use the default sequences

  1. marketing_defaults_seed creates, as drafts, Welcome (user_register), Onboarding Nudge (user_register, stops once setup_completed arrives), Re-engagement (inactivity_14d), Trial Expiry (trial_started) and Payment Failed (payment_failed).
  2. It also creates the mail templates they send (welcome-step-1..3, onboarding-nudge-1..2, reengagement-1..3, trial-expiry-1..3, payment-failed-1..3) on the workspace's mail server: short, plain texts with the unsubscribe link. A template you already have under one of those aliases is kept. Read templates in the answer: error says why templates could not be created (usually no mail server); fix it and seed again, it is safe to repeat.
  3. Edit the templates in the dashboard (Email > Settings, the Templates row of the server tagged Marketing) to sound like the product, then marketing_sequence_activate the ones you want.
  4. Your product must send the trigger events (marketing_trigger_event, or the REST route below).

A broadcast to a segment

  1. marketing_segment_create name="Pro customers" rules='[{"type":"property","property":"plan","operator":"eq","value":"pro"}]'.
  2. marketing_segment_evaluate id=<id> and show the person who matches (count and a few addresses).
  3. marketing_broadcast_create name="November news" segmentId=<id> templateName=<alias> subject="What's new in November".
  4. Ask the person to approve the audience, the template and the subject. Then marketing_broadcast_send id=<id>. It is immediate and cannot be undone.
  5. marketing_broadcast_list shows its send statistics.

Call marketing's REST routes (trigger events from your backend)

  1. Get a bearer token of your workspace that is not a customer seat. A customer's token is refused.
  2. Send it as Authorization: Bearer <token> to https://{org}.marketing.fastflow.tech. The workspace comes from the token.
  3. Events from your backend: POST /api/webhooks/events with {"eventName":"user_register","email":"[email protected]","properties":{"name":"Ana"}}. It does what marketing_trigger_event does.
  4. Check every request shape with service_contract service=marketing before you build on it.

Things that trip agents up

Reference

Where to go next