What are Tags?
Tags are string identifiers associated with workflow instances. Unlike workflow IDs (which are auto-generated UUIDs), tags are human-readable labels you define based on your business logic.Tag Use Cases
- User workflows - Tag with user ID:
user:12345 - Order processing - Tag with order ID:
order:ORD-2024-001 - Multi-tenancy - Tag with tenant ID:
tenant:acme-corp - Workflow groups - Tag with category:
batch:daily-reports - Custom IDs - Use business identifiers instead of UUIDs
Creating Workflows with Tags
Add tags when creating a new workflow:Single Tag
Multiple Tags
Retrieving Workflows by Tag
Get a workflow instance using a tag:Send Signals to Tagged Workflows
Cancel Tagged Workflows
Custom IDs with Tags
Infinitic supports a special tag format for custom IDs:customId: prefix indicates this tag represents a unique identifier for the workflow.
Custom ID Benefits
- Idempotency - Use business IDs to prevent duplicate workflows
- Natural references - Use IDs that make sense in your domain
- Easy lookups - Find workflows using business identifiers
Tag Engine
Infinitic uses a dedicated tag engine to manage the mapping between tags and workflow IDs:- Tags are stored separately from workflow state
- Fast tag-based lookups
- Supports multiple tags per workflow
- Handles tag storage and retrieval
Tag Storage
TheWorkflowTagStorage interface manages tag persistence:
Tag Patterns
Hierarchical Tags
Composite Keys
Typed Tags
Tag Best Practices
Use consistent tag formats
Use consistent tag formats
Define a standard format for tags across your application (e.g.,
type:value).Keep tags immutable
Keep tags immutable
Use namespaced tags
Use namespaced tags
Limit tag count
Limit tag count
While multiple tags are supported, excessive tags can impact performance.
Document tag conventions
Document tag conventions
Maintain documentation of your tag naming conventions and usage patterns.
Use custom IDs for uniqueness
Use custom IDs for uniqueness
When workflows need unique business identifiers, use the
customId: prefix.Tag Limitations
- Tags are immutable after workflow creation
- Tag queries return the workflow stub, not workflow state
- A tag can map to multiple workflow IDs
- Tags are case-sensitive
Example: Multi-Tenant System
Related Topics
- Metadata - Attach custom data to workflows
- CloudEvents - Monitor workflows with tags in events
- Monitoring - Track workflows by tag