Workflow guides
Starting a follow-up workflow across Retell, Twilio, and SendGrid
Use the current execution-key API to start a configured automation, retry safely, and verify channel evidence and connected-app outcomes.

One API entry point can start a configured follow-up workflow that uses Retell for calls, Twilio for texts, and SendGrid for email. The benefit is a single place to initiate the workflow and associate its progress with your business event. Each provider still performs its channel work, and a successful start request does not prove that any customer was reached.
In Tremi, the starting point is an executable automation with declared inputs and configured steps. Copy its run URL and execution key from the app, pass the inputs it expects, and keep the returned run ID alongside your own inquiry or order ID.
Configure the workflow before calling it
Connect the providers you intend to use, select the relevant agent or sender, and configure the workflow's contact timing and completion condition. Confirm the exact connected-app operations needed for any start or completion action.
For an illustrative service inquiry, declare inquiry_id and phone as inputs. Configure the remaining context in the automation or declare additional inputs explicitly. Do not assume an arbitrary JSON property becomes available to a step merely because the API accepted the request envelope.
An email step also needs a valid destination from the automation's configured inputs or mappings. A phone-only example is not a complete three-channel configuration.
Start one run from your server
This illustrative request uses the current execution-key contract. TREMI_RUN_URL and TREMI_EXECUTION_KEY are values you obtain from the configured automation; the inquiry ID and phone are synthetic examples. Replace the input names and values with those declared by your automation.
The request starts real configured work. Use a destination you control for an intentional test, review the steps first, and account for provider charges. Keeping secrets on the server does not make the request a simulation.
curl --request POST "$TREMI_RUN_URL" \
--header "X-Strategy-Execution-Key: $TREMI_EXECUTION_KEY" \
--header "Idempotency-Key: inquiry-demo-001" \
--header "Content-Type: application/json" \
--data '{"inputs":{"inquiry_id":"demo-001","phone":"+14155550101"}}'
Keep the execution key out of browser code, public repositories, and customer-visible logs. Use the authentication method appropriate to the endpoint; do not combine an execution key with user authentication in the same create request.
The create endpoint returns HTTP 201 for a new run and HTTP 200 for a replay of an already accepted matching request. The Idempotent-Replay response header distinguishes that replay. Persist the returned run id before arranging any downstream work that depends on it.
Make the idempotency key describe the intent
Use a stable key for one intended start. If the HTTP response is lost, retry with the same key and identical inputs. Generating a fresh key for the retry turns one business intention into a potential second run.
A different request under an existing key can return HTTP 409. Do not automatically “fix” that response by generating a new key. Compare the original business event and inputs, then decide whether the change is a correction or a genuinely new workflow start. Other execution conflicts can also return 409, so inspect the response details.
This protection concerns the API start. It does not mean that every downstream provider offers identical deduplication guarantees, nor does a timeout from a provider prove that no call or message was accepted. Handle that uncertainty through the workflow's operational recovery process.
Keep channel evidence separate from the outcome
Retell's webhook reference distinguishes call lifecycle events from analysis events. Twilio's message reference distinguishes sending and delivery states. SendGrid's event reference describes email delivery and engagement events.
Those events help explain an attempt, but a booked appointment should come from a verified appointment record or an explicitly defined business event. A customer saying “Tuesday works” is useful conversation evidence; it is not automatically a completed scheduling transaction.
Keep the run ID, business ID, and destination-system record linked. Check a completion action's result separately from the conversation result so a failed CRM update does not disappear behind a successful call.
Connect replies and outside events deliberately
Suppose a text goes out at 09:00 and a call is scheduled for noon. A reply at 11:58 should change the next step when the configured rules call for it. That requires the reply to reach the correct workflow in time; an already accepted call cannot always be prevented by a later stop.
When an appointment or order changes in another app, verify the supported event mapping and correlation key. Two open inquiries belonging to one contact are different units of work. A phone number alone may not identify which one should stop.
Configure and test the completion condition, handoff, and cancellation behavior for the actual workflow. Do not assume that connecting a provider or receiving any reply automatically completes every active run.
Verify one complete path before expanding
Use a small synthetic case to check the full path: create the run, repeat the same request, receive a reply, observe the intended stop or continuation, and inspect the resulting record in the connected app. Include one case that needs staff review and one failed record update.
Read the returned run state together with its results. A completed outreach run may still have an unsuccessful completion action, and a requested cancellation may need already-started work to settle. Define what your application will display while those outcomes are unresolved.
The Retell, Twilio, and SendGrid integration pages are starting points for provider setup. Use the results guide to decide what evidence your application needs before it labels an inquiry replied, booked, or completed.