thread/reply
Reply to a Gmail thread by thread ID, adding a new message to the existing conversation.
vs. message/reply: Use
thread/reply when you have a threadId and want to reply to the thread (optionally targeting a specific message with messageId). Use message/reply when you have a specific messageId and want to reply to that exact message in its thread.
When to Use
- AI-generated thread responses: After fetching the full thread with
thread/getand generating a context-aware reply with an AI agent, post the reply back to the thread. - Automated support responses: A support workflow identifies the thread via a trigger, processes the inquiry, and replies to the thread with the answer or acknowledgment.
- Thread-level workflow notifications: Send status update messages to an existing email conversation thread when a related workflow task is completed.
- Follow-up scheduling: A CRM trigger fires when a lead has been inactive for 7 days — reply to the existing email thread with a follow-up message.
- Approval outcome notification: After a Human-in-the-Loop approves or rejects a request, reply to the original email thread with the decision and next steps.
Configuration
Connection
| Field | Type | Description |
|---|---|---|
credentialId | Guid required | OAuth2 credential ID from BizFirst Credentials Manager. Requires gmail.send scope. |
Operation Fields
| Field | Type | Default | Description |
|---|---|---|---|
threadId | string required | — | Gmail thread ID to reply to. The reply is added as a new message in this thread. |
message | string required | — | Reply body content. HTML or plain text depending on emailType. |
messageId | string optional | — | Specific message within the thread to reply to. When omitted, replies to the most recent message in the thread. |
emailType | enum optional | html | Content type: html or text. |
senderName | string optional | — | Display name for the replying sender. |
ccList | string optional | — | Comma-separated CC addresses for the reply. |
bccList | string optional | — | Comma-separated BCC addresses for the reply. |
attachmentBinaryFields | string[] optional | — | Binary field names from upstream node outputs to attach to the reply. |
replyToSenderOnly | bool optional | false | When true, replies only to the original sender. When false, replies to all participants (Reply-All). |
Sample Configuration
{
"nodeType": "Gmail",
"operation": "thread/reply",
"credentialId": "a3f9d12b-44e1-4c89-b7d2-9f0a1e2b3c4d",
"threadId": "{{support.gmailThreadId}}",
"message": "<p>Dear {{customer.name}},</p><p>Your request has been processed. Here is the outcome: {{resolution.summary}}</p>",
"emailType": "html",
"senderName": "BizFirst Support",
"replyToSenderOnly": true
}
Validation Errors
| Error | Cause | Resolution |
|---|---|---|
MISSING_FIELD: threadId | threadId is empty | Provide a valid Gmail thread ID |
MISSING_FIELD: message | Reply body is empty | Provide non-empty message content |
THREAD_NOT_FOUND | Thread does not exist or is inaccessible | Verify thread ID comes from the authenticated account |
MESSAGE_NOT_FOUND | Optional messageId not found in the thread | Verify the message ID belongs to the specified thread |
INVALID_CREDENTIAL | OAuth token expired or credential not found | Re-authenticate in BizFirst Credentials Manager |
QUOTA_EXCEEDED | Daily send limit reached | Wait for quota reset or switch to Google Workspace account |
Output
Success Port
| Field | Type | Description |
|---|---|---|
messageId | string | Gmail message ID of the new reply |
threadId | string | Thread ID the reply was added to (same as input threadId) |
labelIds | string[] | Labels applied to the reply (e.g. ["SENT"]) |
status | string | success |
errorCode | string | Empty on success |
Error Port
On failure, routes to the error port with status: "error", errorCode, and errorMessage.
Sample Output
{
"messageId": "18e4d5e6f7a8b9c0",
"threadId": "18e4a2f9d3c0b1a7",
"labelIds": ["SENT"],
"status": "success",
"errorCode": ""
}
Expression Reference
| Expression | Resolves To | Example Use |
|---|---|---|
{{support.gmailThreadId}} | Thread ID from support system event | threadId field |
{{aiAgent.generatedReplyHtml}} | AI-generated reply HTML from upstream node | message body |
{{resolution.summary}} | Resolution text from workflow processing | Reply body content |
{{approval.outcome}} | Approval decision text (Approved/Rejected) | Outcome notification in reply |
{{$now | dateFormat:'YYYY-MM-DD HH:mm'}} | Current timestamp | Timestamp in reply body |
Node Policies & GuardRails
| Policy | Rule |
|---|---|
| Reply-All Risk | Default replyToSenderOnly: false is Reply-All — set replyToSenderOnly: true for automated workflows to prevent unintended broadcast replies to all participants |
| Credential Storage | Store OAuth credentials in BizFirst Credentials Manager — never hardcode tokens in workflow configuration |
| Daily Send Limit | Personal Gmail: 500 messages/day; Workspace: 2,000/day — throttle high-volume thread reply workflows |
| PII Protection | Do not log reply body content in workflow execution history — replies may contain sensitive customer information |
| Quota Management | Thread reply costs 100 quota units per send — same as message/send — monitor usage against daily limits |
| Test Isolation | Test thread reply workflows against a dedicated Gmail test account to prevent accidental replies to real customers |
Examples
Example 1: AI-Generated Support Reply
After fetching the thread and generating a response with an AI node, post the reply to the conversation.
{
"nodeType": "Gmail",
"operation": "thread/reply",
"credentialId": "a3f9d12b-44e1-4c89-b7d2-9f0a1e2b3c4d",
"threadId": "{{thread.threadId}}",
"message": "{{aiAgent.replyHtml}}",
"emailType": "html",
"senderName": "BizFirst Support",
"replyToSenderOnly": true
}
Example 2: Approval Outcome Notification
After a HIL approval node processes a request, reply to the original email thread with the approval decision.
{
"nodeType": "Gmail",
"operation": "thread/reply",
"credentialId": "a3f9d12b-44e1-4c89-b7d2-9f0a1e2b3c4d",
"threadId": "{{approvalRequest.threadId}}",
"message": "<p>Dear {{requester.name}},</p><p>Your request has been <strong>{{approval.decision}}</strong>.</p><p>{{approval.notes}}</p>",
"emailType": "html",
"replyToSenderOnly": true
}
Example 3: CRM Follow-Up Thread Reply
A scheduled CRM workflow fires when a lead has been idle 7 days — reply to the existing email thread with a follow-up.
{
"nodeType": "Gmail",
"operation": "thread/reply",
"credentialId": "a3f9d12b-44e1-4c89-b7d2-9f0a1e2b3c4d",
"threadId": "{{crm.lead.lastEmailThreadId}}",
"message": "<p>Hi {{crm.lead.firstName}},</p><p>Just following up on our previous conversation. Are you still interested in learning more about BizFirst? I'd love to schedule a quick call.</p>",
"emailType": "html",
"senderName": "{{crm.assignedRep.name}}",
"replyToSenderOnly": true
}