Every Monday, one email with your Mercury cash, monthly burn and months of runway, last week's money in and out, and where it went.
Uses
GmailMercury
Start every week knowing your cash and runway
recipientEmail to blank.Set recipientEmail to blank.recipientEmail and save it as sendTo.Trim recipientEmail and save it as sendTo.sendTo doesn't contain @If sendTo doesn't contain @Yes
No
No steps
today.Get today's date and save it as today.today and save it as thisMonthStart.Get the start of the month for today and save it as thisMonthStart.thisMonthStart and save it as burnWindowStart.Get the date 3 months before thisMonthStart and save it as burnWindowStart.thisMonthStart and save it as lastMonthEnd.Get the date 1 day before thisMonthStart and save it as lastMonthEnd.today and save it as weekAgo.Get the date 7 days before today and save it as weekAgo.weekAgo and save it as lastWeekStart.Get the start of the week for weekAgo and save it as lastWeekStart.weekAgo and save it as lastWeekEnd.Get the end of the week for weekAgo and save it as lastWeekEnd.lastWeekStart and save it as priorWeeksStart.Get the date 28 days before lastWeekStart and save it as priorWeeksStart.lastWeekStart and save it as priorWeeksEnd.Get the date 1 day before lastWeekStart and save it as priorWeeksEnd.burnWindowStart and save it as fetchFrom.Get the date 1 day before burnWindowStart and save it as fetchFrom.accountList to an empty record.Set accountList to an empty record.accountsErrorIf a step below fails, save the error as accountsErrorTry
accountList.List accounts Save it as accountList.On error
accountsError.message.Stop and report a problem: Lodol could not read your Mercury accounts, so no report was sent. Check the Mercury connection under Integrations, then run this again. Mercury said: accountsError.message.treasuryList to an empty record.Set treasuryList to an empty record.treasuryErrorIf a step below fails, save the error as treasuryErrorTry
treasuryList.List treasury accounts Save it as treasuryList.On error
treasuryError.message.Stop and report a problem: Lodol could not read your Mercury Treasury balance, so no report was sent rather than one with your cash understated. Check the Mercury connection under Integrations, then run this again. Mercury said: treasuryError.message.id from every item in treasuryList.items and save it as treasuryIds.Get id from every item in treasuryList.items and save it as treasuryIds.accountList.items where item.status is active and treasuryIds doesn't contain item.id and save it as bankAccounts.Keep each item in accountList.items where item.status is active and treasuryIds doesn't contain item.id and save it as bankAccounts.bankAccounts is emptyIf bankAccounts is emptyYes
No
No steps
treasuryList.items where item.status is active and save it as treasuryAccounts.Keep each item in treasuryList.items where item.status is active and save it as treasuryAccounts.id from every item in bankAccounts and save it as bankAccountIds.Get id from every item in bankAccounts and save it as bankAccountIds.currentBalance from every item in bankAccounts and save it as bankBalances.Get currentBalance from every item in bankAccounts and save it as bankBalances.bankBalances and save it as bankTotal.Add up bankBalances and save it as bankTotal.currentBalance from every item in treasuryAccounts and save it as treasuryBalances.Get currentBalance from every item in treasuryAccounts and save it as treasuryBalances.treasuryBalances and save it as treasuryTotal.Add up treasuryBalances and save it as treasuryTotal.settledCash to bankTotal plus treasuryTotal.Set settledCash to bankTotal plus treasuryTotal.accountList.items by createdAt, smallest first and save it as accountsByAge.Sort accountList.items by createdAt, smallest first and save it as accountsByAge.firstOpened to accountsByAge[0].createdAt.Set firstOpened to accountsByAge[0].createdAt.burnFrom to burnWindowStart.Set burnFrom to burnWindowStart.firstOpened is greater than burnWindowStartIf firstOpened is greater than burnWindowStartYes
firstOpened and save it as monthAfterOpening.Get the date 1 month after firstOpened and save it as monthAfterOpening.monthAfterOpening and save it as burnFrom.Get the start of the month for monthAfterOpening and save it as burnFrom.No
No steps
burnFrom to thisMonthStart and save it as burnMonths.Count the months from burnFrom to thisMonthStart and save it as burnMonths.transactions to an empty list.Set transactions to an empty list.nextPage to nothing.Set nextPage to nothing.morePages to true.Set morePages to true.pagesRead to 0.Set pagesRead to 0.morePages is yes:While morePages is yes:page to an empty record.Set page to an empty record.transactionsErrorIf a step below fails, save the error as transactionsErrorTry
page.List transactions Save it as page.On error
transactionsError.message.Stop and report a problem: Lodol could not read your Mercury transactions, so no report was sent rather than one with burn and runway worked out from part of the picture. Check the Mercury connection under Integrations, then run this again. Mercury said: transactionsError.message.transactions and page.items into one list and save it as transactions.Combine transactions and page.items into one list and save it as transactions.pagesRead.Add 1 to pagesRead.morePages to false.Change morePages to false.page.items is greater than or equal to 500If the length of page.items is greater than or equal to 500Yes
page.next_cursor is nextPageIf page.next_cursor is nextPageYes
No
No steps
pagesRead is greater than or equal to 40If pagesRead is greater than or equal to 40Yes
No
No steps
nextPage to page.next_cursor.Change nextPage to page.next_cursor.morePages to true.Change morePages to true.No
No steps
transactions where item.kind is not internalTransfer and item.kind is not treasuryTransfer… and save it as countedTransactions.Keep each item in transactions where item.kind is not internalTransfer and item.kind is not treasuryTransfer… and save it as countedTransactions.countedTransactions where item.status is pending and bankAccountIds contains item.accountId and save it as pendingFromAccounts.Keep each item in countedTransactions where item.status is pending and bankAccountIds contains item.accountId and save it as pendingFromAccounts.amount from every item in pendingFromAccounts and save it as pendingAmounts.Get amount from every item in pendingFromAccounts and save it as pendingAmounts.pendingAmounts and save it as pendingTotal.Add up pendingAmounts and save it as pendingTotal.pendingTotal and save it as pendingOut.Calculate the absolute value of pendingTotal and save it as pendingOut.cash to settledCash minus pendingOut.Set cash to settledCash minus pendingOut.countedTransactions where item.createdAt is greater than or equal to lastWeekStart and item.createdAt… and save it as lastWeek.Keep each item in countedTransactions where item.createdAt is greater than or equal to lastWeekStart and item.createdAt… and save it as lastWeek.lastWeek where item.amount is greater than 0 and save it as moneyInLastWeek.Keep each item in lastWeek where item.amount is greater than 0 and save it as moneyInLastWeek.lastWeek where item.amount is less than 0 and save it as moneyOutLastWeek.Keep each item in lastWeek where item.amount is less than 0 and save it as moneyOutLastWeek.amount from every item in moneyInLastWeek and save it as inLastWeekAmounts.Get amount from every item in moneyInLastWeek and save it as inLastWeekAmounts.inLastWeekAmounts and save it as inLastWeekTotal.Add up inLastWeekAmounts and save it as inLastWeekTotal.amount from every item in moneyOutLastWeek and save it as outLastWeekAmounts.Get amount from every item in moneyOutLastWeek and save it as outLastWeekAmounts.outLastWeekAmounts and save it as outLastWeekTotal.Add up outLastWeekAmounts and save it as outLastWeekTotal.outLastWeekTotal and save it as outLastWeek.Calculate the absolute value of outLastWeekTotal and save it as outLastWeek.countedTransactions where item.createdAt is greater than or equal to priorWeeksStart and item.createdAt… and save it as priorWeeks.Keep each item in countedTransactions where item.createdAt is greater than or equal to priorWeeksStart and item.createdAt… and save it as priorWeeks.priorWeeks where item.amount is greater than 0 and save it as moneyInPriorWeeks.Keep each item in priorWeeks where item.amount is greater than 0 and save it as moneyInPriorWeeks.priorWeeks where item.amount is less than 0 and save it as moneyOutPriorWeeks.Keep each item in priorWeeks where item.amount is less than 0 and save it as moneyOutPriorWeeks.amount from every item in moneyInPriorWeeks and save it as inPriorWeeksAmounts.Get amount from every item in moneyInPriorWeeks and save it as inPriorWeeksAmounts.inPriorWeeksAmounts and save it as inPriorWeeksTotal.Add up inPriorWeeksAmounts and save it as inPriorWeeksTotal.amount from every item in moneyOutPriorWeeks and save it as outPriorWeeksAmounts.Get amount from every item in moneyOutPriorWeeks and save it as outPriorWeeksAmounts.outPriorWeeksAmounts and save it as outPriorWeeksTotal.Add up outPriorWeeksAmounts and save it as outPriorWeeksTotal.outPriorWeeksTotal and save it as outPriorWeeks.Calculate the absolute value of outPriorWeeksTotal and save it as outPriorWeeks.inWeeklyAverage to inPriorWeeksTotal divided by 4.Set inWeeklyAverage to inPriorWeeksTotal divided by 4.outWeeklyAverage to outPriorWeeks divided by 4.Set outWeeklyAverage to outPriorWeeks divided by 4.inLastWeekTotal as US dollars with 0 decimal places and save it as inLastWeekText.Format inLastWeekTotal as US dollars with 0 decimal places and save it as inLastWeekText.outLastWeek as US dollars with 0 decimal places and save it as outLastWeekText.Format outLastWeek as US dollars with 0 decimal places and save it as outLastWeekText.inWeeklyAverage as US dollars with 0 decimal places and save it as inAverageText.Format inWeeklyAverage as US dollars with 0 decimal places and save it as inAverageText.outWeeklyAverage as US dollars with 0 decimal places and save it as outAverageText.Format outWeeklyAverage as US dollars with 0 decimal places and save it as outAverageText.(average of the 4 weeks before: @inAverageText) and save it as inComparison.Build the text (average of the 4 weeks before: @inAverageText) and save it as inComparison.(average of the 4 weeks before: @outAverageText) and save it as outComparison.Build the text (average of the 4 weeks before: @outAverageText) and save it as outComparison.averageNote to blank.Set averageNote to blank.firstOpened is greater than priorWeeksStartIf firstOpened is greater than priorWeeksStartYes
inComparison to blank.Change inComparison to blank.outComparison to blank.Change outComparison to blank.averageNote to:Change averageNote to:Your Mercury history is too short to compare with the 4 weeks before yet.No
No steps
weekNet to inLastWeekTotal minus outLastWeek.Set weekNet to inLastWeekTotal minus outLastWeek.weekNet and save it as weekNetSize.Calculate the absolute value of weekNet and save it as weekNetSize.weekNetSize as US dollars with 0 decimal places and save it as weekNetText.Format weekNetSize as US dollars with 0 decimal places and save it as weekNetText.weekNetSentence to Money in and money out were level..Set weekNetSentence to Money in and money out were level..lastWeek is emptyIf lastWeek is emptyYes
weekNetSentence to No money came in or went out..Change weekNetSentence to No money came in or went out..Else if @weekNet is greater than 0
More came in than went out, by @weekNetText. and save it as weekNetSentence.Build the text More came in than went out, by @weekNetText. and save it as weekNetSentence.Else if @weekNet is less than 0
@weekNetText more went out than came in. and save it as weekNetSentence.Build the text @weekNetText more went out than came in. and save it as weekNetSentence.Otherwise
No steps
lastWeekStart readable as “Mon Nov 2” and save it as lastWeekStartText.Make lastWeekStart readable as “Mon Nov 2” and save it as lastWeekStartText.lastWeekEnd readable as “Mon Nov 2” and save it as lastWeekEndText.Make lastWeekEnd readable as “Mon Nov 2” and save it as lastWeekEndText.moneyOutLastWeek by counterpartyName, with the total amount of each and save it as payees.Group the items in moneyOutLastWeek by counterpartyName, with the total amount of each and save it as payees.payees by total, smallest first and save it as payeesBySpend.Sort payees by total, smallest first and save it as payeesBySpend.payeesBySpend and save it as topPayees.Take the first 5 items of payeesBySpend and save it as topPayees.topPayeeLines to an empty list.Set topPayeeLines to an empty list.rank to 0.Set rank to 0.payee in topPayees:For each payee in topPayees:rank.Add 1 to rank.payee.total and save it as payeeSpend.Calculate the absolute value of payee.total and save it as payeeSpend.payeeSpend as US dollars with 0 decimal places and save it as payeeSpendText.Format payeeSpend as US dollars with 0 decimal places and save it as payeeSpendText.payeeName to payee.key.Set payeeName to payee.key.payeeName is emptyIf payeeName is emptyYes
payeeName to Payee not named by Mercury.Change payeeName to Payee not named by Mercury.No
No steps
paymentCount to blank.Set paymentCount to blank.payee.count is greater than 1If payee.count is greater than 1Yes
(@payee.count payments) and save it as paymentCount.Build the text (@payee.count payments) and save it as paymentCount.No
No steps
rank. payeeName: payeeSpendText@paymentCount to the end of topPayeeLines and save it as topPayeeLines.Add rank. payeeName: payeeSpendText@paymentCount to the end of topPayeeLines and save it as topPayeeLines.topPayeeLines with a new line and save it as topPayeesText.Join topPayeeLines with a new line and save it as topPayeesText.moneyOutLastWeek is emptyIf moneyOutLastWeek is emptyYes
topPayeesText to No money went out last week..Change topPayeesText to No money went out last week..No
No steps
largestInText to No money came in last week..Set largestInText to No money came in last week..moneyInLastWeek isn't emptyIf moneyInLastWeek isn't emptyYes
moneyInLastWeek by amount, largest first and save it as incomingBySize.Sort moneyInLastWeek by amount, largest first and save it as incomingBySize.incomingBySize[0].amount as US dollars with 0 decimal places and save it as largestInAmount.Format incomingBySize[0].amount as US dollars with 0 decimal places and save it as largestInAmount.incomingBySize[0].createdAt readable as “Monday, November 2” and save it as largestInDay.Make incomingBySize[0].createdAt readable as “Monday, November 2” and save it as largestInDay.incomingBySize[0].counterpartyName, or A payer Mercury did not name if it is empty and save it as payerName.Use incomingBySize[0].counterpartyName, or A payer Mercury did not name if it is empty and save it as payerName.@payerName: @largestInAmount on @largestInDay and save it as largestInText.Build the text @payerName: @largestInAmount on @largestInDay and save it as largestInText.No
No steps
balanceLines to an empty list.Set balanceLines to an empty list.account in bankAccounts:For each account in bankAccounts:accountName to account.name.Set accountName to account.name.account.nickname isn't emptyIf account.nickname isn't emptyYes
@account.nickname (@account.name) and save it as accountName.Build the text @account.nickname (@account.name) and save it as accountName.No
No steps
account.currentBalance as US dollars with 2 decimal places and save it as accountBalanceText.Format account.currentBalance as US dollars with 2 decimal places and save it as accountBalanceText.accountName: accountBalanceText to the end of balanceLines and save it as balanceLines.Add accountName: accountBalanceText to the end of balanceLines and save it as balanceLines.treasuryAccount in treasuryAccounts:For each treasuryAccount in treasuryAccounts:treasuryAccount.currentBalance as US dollars with 2 decimal places and save it as treasuryBalanceText.Format treasuryAccount.currentBalance as US dollars with 2 decimal places and save it as treasuryBalanceText.treasuryBalanceText to the end of balanceLines and save it as balanceLines.Add Mercury Treasury: treasuryBalanceText to the end of balanceLines and save it as balanceLines.pendingOut is greater than 0If pendingOut is greater than 0Yes
pendingOut as US dollars with 2 decimal places and save it as pendingOutText.Format pendingOut as US dollars with 2 decimal places and save it as pendingOutText.pendingOutText to the end of balanceLines and save it as balanceLines.Add Less payments still pending: pendingOutText to the end of balanceLines and save it as balanceLines.No
No steps
cash as US dollars with 2 decimal places and save it as cashExactText.Format cash as US dollars with 2 decimal places and save it as cashExactText.cashExactText to the end of balanceLines and save it as balanceLines.Add Cash: cashExactText to the end of balanceLines and save it as balanceLines.cash as US dollars with 0 decimal places and save it as cashText.Format cash as US dollars with 0 decimal places and save it as cashText.balanceLines with a new line and save it as balancesText.Join balanceLines with a new line and save it as balancesText.Cash @cashText · not enough history yet for burn and runway and save it as headline.Build the text Cash @cashText · not enough history yet for burn and runway and save it as headline.methodLine to Burn and runway appear once your Mercury accounts have a full calendar month of history. Burn is money out minus money in, averaged per month over up to the last three full months, and runway is cash divided by burn..Set methodLine to Burn and runway appear once your Mercury accounts have a full calendar month of history. Burn is money out minus money in, averaged per month over up to the last three full months, and runway is cash divided by burn..burnMonths is greater than or equal to 1If burnMonths is greater than or equal to 1Yes
countedTransactions where item.createdAt is greater than or equal to burnFrom and item.createdAt is… and save it as burnWindow.Keep each item in countedTransactions where item.createdAt is greater than or equal to burnFrom and item.createdAt is… and save it as burnWindow.amount from every item in burnWindow and save it as burnWindowAmounts.Get amount from every item in burnWindow and save it as burnWindowAmounts.burnWindowAmounts and save it as burnWindowTotal.Add up burnWindowAmounts and save it as burnWindowTotal.netOutflow to burnWindowTotal multiplied by -1.Set netOutflow to burnWindowTotal multiplied by -1.burn to netOutflow divided by burnMonths.Set burn to netOutflow divided by burnMonths.burnInHundreds to burn divided by 100.Set burnInHundreds to burn divided by 100.burnInHundreds to the nearest integer and save it as burnHundredsRounded.Round burnInHundreds to the nearest integer and save it as burnHundredsRounded.burnRounded to burnHundredsRounded multiplied by 100.Set burnRounded to burnHundredsRounded multiplied by 100.burn is less than 1000If the absolute value of burn is less than 1000Yes
burn to the nearest integer and save it as burnRounded.Round burn to the nearest integer and save it as burnRounded.No
No steps
burnFrom readable as “November 2026” and save it as monthsFrom.Make burnFrom readable as “November 2026” and save it as monthsFrom.lastMonthEnd readable as “November 2026” and save it as monthsTo.Make lastMonthEnd readable as “November 2026” and save it as monthsTo.the @burnMonths full months from @monthsFrom to @monthsTo and save it as monthsPhrase.Build the text the @burnMonths full months from @monthsFrom to @monthsTo and save it as monthsPhrase.burnMonths is 1If burnMonths is 1Yes
monthsPhrase to monthsTo.Change monthsPhrase to monthsTo.No
No steps
burnWindow is emptyIf burnWindow is emptyYes
Cash @cashText · no money in or out over @monthsPhrase and save it as headline.Build the text Cash @cashText · no money in or out over @monthsPhrase and save it as headline.No money came in or went out over @monthsPhrase, so there is no burn to measure or runway to work out. and save it as methodLine.Build the text No money came in or went out over @monthsPhrase, so there is no burn to measure or runway to work out. and save it as methodLine.Else if @burnRounded is 0
Cash @cashText · money in and out level over @monthsPhrase and save it as headline.Build the text Cash @cashText · money in and out level over @monthsPhrase and save it as headline.Money in and money out came to within a dollar a month of each other over @monthsPhrase, so there is no burn to measure or runway to work out. and save it as methodLine.Build the text Money in and money out came to within a dollar a month of each other over @monthsPhrase, so there is no burn to measure or runway to work out. and save it as methodLine.Else if @burn is greater than 0
burnRounded as US dollars with 0 decimal places and save it as burnText.Format burnRounded as US dollars with 0 decimal places and save it as burnText.runwayMonths to cash divided by burn.Set runwayMonths to cash divided by burn.runwayMonths down to 1 decimal place and save it as runwayShown.Round runwayMonths down to 1 decimal place and save it as runwayShown.@runwayShown months of runway and save it as runwayPhrase.Build the text @runwayShown months of runway and save it as runwayPhrase.cash is less than or equal to 0If cash is less than or equal to 0Yes
runwayPhrase to no cash left to run on.Change runwayPhrase to no cash left to run on.Else if @runwayMonths is greater than or equal to 120
runwayPhrase to more than 10 years of runway.Change runwayPhrase to more than 10 years of runway.Else if @runwayShown is 1
runwayPhrase to 1 month of runway.Change runwayPhrase to 1 month of runway.Otherwise
No steps
Cash @cashText · @runwayPhrase · burn @burnText/month and save it as headline.Build the text Cash @cashText · @runwayPhrase · burn @burnText/month and save it as headline.Burn is money out minus money in, averaged per month over @monthsPhrase. Runway is cash divided by burn, rounded down. and save it as methodLine.Build the text Burn is money out minus money in, averaged per month over @monthsPhrase. Runway is cash divided by burn, rounded down. and save it as methodLine.Otherwise
burnRounded and save it as monthlyGain.Calculate the absolute value of burnRounded and save it as monthlyGain.monthlyGain as US dollars with 0 decimal places and save it as monthlyGainText.Format monthlyGain as US dollars with 0 decimal places and save it as monthlyGainText.Cash @cashText · cash-flow positive · @monthlyGainText/month more in than out and save it as headline.Build the text Cash @cashText · cash-flow positive · @monthlyGainText/month more in than out and save it as headline.More came in than went out over @monthsPhrase, so there is no burn and no runway limit. The figure above is money in minus money out, averaged per month. and save it as methodLine.Build the text More came in than went out over @monthsPhrase, so there is no burn and no runway limit. The figure above is money in minus money out, averaged per month. and save it as methodLine.No
No steps
today readable as “Monday, November 2, 2026” and save it as reportDate.Make today readable as “Monday, November 2, 2026” and save it as reportDate.Weekly cash report · @reportDate and save it as companyLine.Build the text Weekly cash report · @reportDate and save it as companyLine.bankAccounts[0].legalBusinessName isn't emptyIf bankAccounts[0].legalBusinessName isn't emptyYes
Weekly cash report for @bankAccounts[0].legalBusinessName · @reportDate and save it as companyLine.Build the text Weekly cash report for @bankAccounts[0].legalBusinessName · @reportDate and save it as companyLine.No
No steps
sendErrorIf a step below fails, save the error as sendErrorTry
sendTo. Save it as sent.Send an email to sendTo. Save it as sent.
Subject: headlineheadline
companyLine
Last week: lastWeekStartText to lastWeekEndText
Money in: inLastWeekText@inComparison
Money out: outLastWeekText@outComparison
weekNetSentence@averageNote
...On error
sendTo. Check the Gmail connection under Integrations, then run this again. Gmail said: sendError.message.Stop and report a problem: The weekly cash report was ready but could not be emailed to sendTo. Check the Gmail connection under Integrations, then run this again. Gmail said: sendError.message.sendTo: headline.Finish the run: Emailed the weekly cash report to sendTo: headline.