remove_conversation_tag
Remove a tag from the current conversation, for example to take it out of a tag-driven queue.
remove_conversation_tag(context: dict, tag: str) -> boolRemoves a tag from the conversation. Only the link between this conversation and the tag is removed — the tag itself stays available to your organization and on any other conversation carrying it.
Parameters
| Name | Type | Description |
|---|---|---|
context | dict | The context object passed to your action |
tag | str | The tag text to remove |
Returns
bool — True if the tag was removed, False if the conversation did not have it.
Behavior
- Read the conversation's current tags from
context["conversation"]["tags"]. - Does not fire the
tag_modifiedevent, so a handler that untags ontag_modifiedcannot re-trigger itself. - Returns
Falserather than raising when the tag was not present.
Examples
Take a conversation out of a queue
def execute_action(context):
# ... do the work the queue existed for ...
remove_conversation_tag(context, "needs-review")
return {"reviewed": True}Swap one status tag for another
def execute_action(context):
remove_conversation_tag(context, "escalation-pending")
add_conversation_tag(context, "escalation-resolved")Only act if the tag was actually there
def handle_event(context):
if remove_conversation_tag(context, "awaiting-customer"):
add_conversation_note(context, "Customer replied — removed the waiting tag.")A recurring job that polls for a tag should remove it as part of processing. Without that, the same conversations come back on every run — which is what makes untagging worth doing in the same action as the work.