Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[💡 FEATURE REQUEST]: Typed Search Attributes #2097

Open
rustatian opened this issue Dec 20, 2024 · 1 comment · May be fixed by temporalio/roadrunner-temporal#599
Open

[💡 FEATURE REQUEST]: Typed Search Attributes #2097

rustatian opened this issue Dec 20, 2024 · 1 comment · May be fixed by temporalio/roadrunner-temporal#599
Assignees
Labels
C-feature-accepted Category: Feature discussed and accepted
Milestone

Comments

@rustatian
Copy link
Member

Plugin

Temporal

I have an idea!

Plugin

Temporal

I have an idea!

When starting a Child Workflow, we can pass SearchAttributes in the ExecuteChildWorkflow command.
SA are packed into a regular array as JSON within the options field.

We need to add support for TypedSearchAttributes and allow passing SearchAttributes as protobuf.

Related issue: temporalio/sdk-php#516

CC: @roxblnfk
Original issue: temporalio/roadrunner-temporal#596

@rustatian rustatian added the C-feature-accepted Category: Feature discussed and accepted label Dec 20, 2024
@rustatian rustatian added this to the v2024.3.2 milestone Dec 20, 2024
@rustatian rustatian self-assigned this Dec 20, 2024
@rustatian rustatian moved this to 🔖 Ready in Jira 😄 Dec 20, 2024
@rustatian
Copy link
Member Author

rustatian commented Dec 23, 2024

Protocol:

  1. Command name: UpsertWorkflowTypedSearchAttributes
  2. Payload is the same as for the regular (untyped) search attributes, except the value is now typed. This is the regular associate array map[string]*struct, but the value (*struct) is typed. It is not contains two fields: type (string) and value (int, bool, float, string, []string).
    Example:
{
"key1": {
	"type": "float64",
        "operation": "unset"
},
"key2": {
	"type": "bool",
        "operation": "set",
	"value": true
	},
"key3": {
	"type": "keyword_list",
        "operation": "set",
	"value": ["1", "2"]
	}
}

Where: "key1,2,3" are search attribute names with nested values and corresponding types.

Types can be:

  1. bool: values: true, false (json native).
  2. float64: values: 1.2, 2.5 (json native).
  3. int: values: 1,2 (json native)
  4. keyword: values: string, native.
  5. keyword_list: values: array of string, native.
  6. string: values native string.
  7. datetime: values: time in RFC 3339 format. Will be parsed on the RR side.

Payload may have any number of variations of these types.

When the type or value can't be parsed correctly, RR will send the warn-level log and continue parsing the next field.

Operations can be:

  1. set - to set a SA. Used by default if not set (field).
  2. unset - to unset the SA.

@rustatian rustatian moved this from 🔖 Ready to 🏗 In progress in Jira 😄 Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-accepted Category: Feature discussed and accepted
Projects
Status: 🏗 In progress
Development

Successfully merging a pull request may close this issue.

1 participant