You can search your inbox with search_emails. Now the other side: putting an email into Gmail. What's the last thing you drafted manually?
After search_emails I can find investor threads. The other half is drafting the weekly update — subject, body, formatted metrics. I still do that by hand every Monday.
GMAIL_CREATE_EMAIL_DRAFT saves a draft to your Gmail without sending it. You get to review it before it goes anywhere. The pattern is always draft-first, send-second for any write action:
result = toolset.execute_action(
Action.GMAIL_CREATE_EMAIL_DRAFT,
{"to": to, "subject": subject, "body": body}
)
print(result.get("id", "no draft id"))Why draft instead of send directly? The body is already formatted — what's the point of the extra step?
Safety. A draft gives you one last look — wrong recipient, typo in MRR, missing metric. GMAIL_SEND_EMAIL is irreversible. Drafts are free to discard. In any automated workflow, always draft, review, then send. Here's the full function:
def draft_email(to: str, subject: str, body: str) -> dict:
result = toolset.execute_action(
Action.GMAIL_CREATE_EMAIL_DRAFT,
{"to": to, "subject": subject, "body": body}
)
print(f"Draft created: {result.get('id', 'no id')}")
return resultSo I can chain investor_update(metrics) from the Python track into draft_email — formatted update goes straight into Gmail drafts, ready to review.
Your Monday morning just became: run investor_update, pass the output to draft_email, open Gmail to review. Two function calls and one click to send.
The Python track built the formatter. The automation track connects it to the real app. They compose perfectly.
Always log the draft ID returned by the action. If something goes wrong downstream, the draft ID lets you retrieve and debug. result.get('id') is your audit trail.
GMAIL_CREATE_EMAIL_DRAFT saves to Gmail Drafts without sending.
toolset.execute_action(
Action.GMAIL_CREATE_EMAIL_DRAFT,
{"to": "me@example.com", "subject": "...", "body": "..."}
)Always draft first in automated workflows:
draft_email(to, subject, body) — saves draft, no deliverysend_email(to, subject, body) — only when confidentDon't skip the draft step in production workflows. Automated sends with a wrong recipient are very hard to undo.
You can search your inbox with search_emails. Now the other side: putting an email into Gmail. What's the last thing you drafted manually?
After search_emails I can find investor threads. The other half is drafting the weekly update — subject, body, formatted metrics. I still do that by hand every Monday.
GMAIL_CREATE_EMAIL_DRAFT saves a draft to your Gmail without sending it. You get to review it before it goes anywhere. The pattern is always draft-first, send-second for any write action:
result = toolset.execute_action(
Action.GMAIL_CREATE_EMAIL_DRAFT,
{"to": to, "subject": subject, "body": body}
)
print(result.get("id", "no draft id"))Why draft instead of send directly? The body is already formatted — what's the point of the extra step?
Safety. A draft gives you one last look — wrong recipient, typo in MRR, missing metric. GMAIL_SEND_EMAIL is irreversible. Drafts are free to discard. In any automated workflow, always draft, review, then send. Here's the full function:
def draft_email(to: str, subject: str, body: str) -> dict:
result = toolset.execute_action(
Action.GMAIL_CREATE_EMAIL_DRAFT,
{"to": to, "subject": subject, "body": body}
)
print(f"Draft created: {result.get('id', 'no id')}")
return resultSo I can chain investor_update(metrics) from the Python track into draft_email — formatted update goes straight into Gmail drafts, ready to review.
Your Monday morning just became: run investor_update, pass the output to draft_email, open Gmail to review. Two function calls and one click to send.
The Python track built the formatter. The automation track connects it to the real app. They compose perfectly.
Always log the draft ID returned by the action. If something goes wrong downstream, the draft ID lets you retrieve and debug. result.get('id') is your audit trail.
GMAIL_CREATE_EMAIL_DRAFT saves to Gmail Drafts without sending.
toolset.execute_action(
Action.GMAIL_CREATE_EMAIL_DRAFT,
{"to": "me@example.com", "subject": "...", "body": "..."}
)Always draft first in automated workflows:
draft_email(to, subject, body) — saves draft, no deliverysend_email(to, subject, body) — only when confidentDon't skip the draft step in production workflows. Automated sends with a wrong recipient are very hard to undo.
Create a free account to get started. Paid plans unlock all tracks.