← All ivy-nodes
IVYXSTUDIO · IVY NODE
H
Has a Gmail message
ivy.node.has-gmail-message · v0.1.0
ivyx✓
Says whether a statement came with a Gmail message to mark: true when the message's id is known (a Gmail trigger hands it as $parent.id), false for a file given by hand. Lets the Gmail agent end without a mark step that fails for want of a message, as has-mail does for a mailbox; an if over a missing input does not resolve and would fail the run (2026-10-16).
#mail#gmail#routing
Inputs
| Field | Type | Description |
|---|---|---|
| message_id | string | The Gmail message's id, when there was one. |
Outputs
| Field | Type | Description |
|---|---|---|
| has_messagerequired | boolean | True when there is a Gmail message to mark. |
Source
python
# Input preparation
inp = __ivy_ctx__["nodes"][__ivy_node_id__]["input"]
# Compute
class HasGmailMessage:
"Has a Gmail message"
def run(self, inp):
out = {}
# Whether a statement came with a Gmail message to mark: its id.
message_id = str(inp.get("message_id") or "").strip()
out = {"has_message": bool(message_id)}
return out
result = HasGmailMessage().run(inp)
# Output collection (the runner reads it here)
out = __ivy_ctx__["nodes"][__ivy_node_id__]["output"]
out.update(result)Tests
Requires: python:3.9
- message
A message id means a Gmail message to mark.
- blank
A blank id names no message.
- none
Nothing known means nothing to mark.