What the agent does
This job needs no repository. The agent works through your Stripe connection, Stripe's own remote MCP server at mcp.stripe.com, which Rush lists among its connectors; the request names it in connections, so the run gets that connection and no other. The server's stripe_api_read tool covers the list and retrieve methods for subscriptions, customers, invoices, prices and products, and the prompt says read only, so the agent never calls stripe_api_write.
The agent starts by listing subscriptions with a trial_end inside the reporting window, in every status, since a converted trial is now active or past_due, a lost one is canceled or incomplete_expired, and a few are still trialing with an extended trial. For each it reads trial_start, trial_end, status, canceled_at, cancellation_details (reason, feedback and comment), default_payment_method, trial_settings.end_behavior.missing_payment_method, and the price and product on items. It retrieves the customer for the name and email domain and the first invoice after trial_end to confirm whether a payment was collected, because a subscription can be active while its first invoice is still open.
With that it classifies each trial: converted (a paid invoice after trial_end), cancelled during trial (canceled_at on or before trial_end), lost at trial end (no payment method and the end behaviour cancelled or paused it, or the first invoice failed), and still trialing. The report groups the outcomes by product and price, by signup week from trial_start, and by whether a payment method was on file at trial end, and lists the stated cancellation reasons with their counts and any free-text comments. It also reports the days from trial_start to the first paid invoice as a distribution rather than a single average, and names the accounts with the largest first-invoice amounts that did not convert.
Everything is written to trial-conversion.md as an artifact on the session: a summary table, one section per grouping, the reasons list, and a method note that says which Stripe objects and fields each number came from and which subscriptions were left out because a field was missing. The agent changes nothing in the account.
Start it with one API call
POST https://api.phoenix.so/o/{org}/sessions with this body:
{
"agent": "claude",
"input": "Use the Stripe connection to list every subscription whose trial_end fell in the last calendar month, in all statuses. For each, read trial_start, trial_end, status, canceled_at, cancellation_details, default_payment_method, trial_settings.end_behavior, the items' price and product, the customer, and the first invoice after trial_end with its status and amount_paid. Classify each trial as converted, cancelled during trial, lost at trial end, or still trialing, and say how you decided. Write trial-conversion.md with a summary table, conversion by product and price, by signup week, and by whether a payment method was on file at trial end, the stated cancellation reasons and comments with counts, the distribution of days from trial start to first payment, and the five largest non-converted trials by first-invoice amount. End with a method section naming the fields behind each number and any subscriptions excluded for missing data. Read only: do not create, update or cancel anything in Stripe.",
"connections": [
"stripe"
]
}- Get an API key. In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
- Send the request. POST the body in request.json to https://api.phoenix.so/o/{org}/sessions, with your repository as the resources URL. The run starts in its own cloud sandbox.
- Read what came back. Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.
What comes back
What comes back is trial-conversion.md as an artifact on the session, readable from GET /o/{org}/sessions/{id} through the artifact's link. It opens with the window and the counts in each outcome, then the tables by product and price, by signup week and by payment method on file, the reasons list with comments quoted verbatim, the days-to-payment distribution, the largest lost trials, and the method section.
The transcript at GET /o/{org}/sessions/{id}/messages lists every stripe_api_read call with its parameters and what came back, so a reviewer can check any row in the report against the Stripe objects behind it. The session lists no pull request and the account is unchanged.
Before sharing the report, a reviewer checks the window against their billing calendar (a trial that ends on the first of the month belongs to whichever month the team counts it in), confirms that past_due after a paid first invoice counts as converted for their purposes, and decides whether customers created from a test clock should be excluded.
Run it on every first of the month
Trials are read by month, so have a scheduler on your server send this request on the first of each month with a request_id that is a UUID v5 of the month, so a retried call returns the first run rather than starting a second. Each run reads the account as it stands that morning, and the reports stack into a month-by-month record of conversion.
Set a webhook URL on the API key and Rush POSTs run.completed when the run finishes, with session_url; your server reads the session, takes the trial-conversion.md link from its artifacts and posts it where the growth team reviews the month.
The use case this job follows, with its automation and trigger: Produce a report or file, no repo.
Why run it on Rush?
Trial conversion is simple to define and tedious to compute: it needs subscriptions in every status, the invoice after each trial, the cancellation details and the customer, joined by hand. The Stripe dashboard shows pieces of it; the agent reads the objects through the connection, applies one stated rule to each trial, and writes the rule beside the number.
The run keeps every call it made in its transcript, so a figure in the report can be traced to the Stripe objects behind it, and the connection is read-only by the prompt's own instruction. Several Stripe accounts can be reported at the same time in separate runs, each with its own connection.
Frequently asked questions
Does the agent change anything in Stripe?
No. The prompt says read only and the agent uses stripe_api_read only; stripe_api_write is never called. The transcript on the session shows every call, so this can be checked after the fact.
How does it tell a conversion from a subscription that is active but unpaid?
It reads the first invoice after trial_end. A subscription whose first invoice is paid counts as converted; one whose first invoice is open or failed is reported separately, with the invoice status, rather than folded into either side.
Can it run for a different window or a single product?
Yes. Change the window or add a product or price in input; the classification and the tables are the same. A weekly run with a seven-day window works for teams that watch trials closely.
Where do the cancellation reasons come from?
From cancellation_details on each subscription: reason, feedback and comment, as the customer portal or your own cancel flow set them. Trials cancelled by Stripe at trial end for a missing payment method have no customer feedback, and the report says so.
More Stripe jobs
More jobs like this: Produce a report or file, no repo
- List Unpaid PayPal Invoices and Draft Reminders (PayPal)
- Plan an Upgrade to Next.js 16 (Next.js)
- Triage New Sentry Issues Every Week (Sentry)