Currently all blob payload fields do not have any associated metadata. It works only in monolithic applications, but might cause a lot of compatibility issues when Temporal is used as an asynchronous service mesh that connects multiple services. Another problem is that migrating applications from one encoding scheme to another is practically impossible while workflows are running.
The strawman solution is to change all the binary blobs to Payload (name is up to the discussion) which includes Header field.
This would allow to specify something like: this is an encrypted field with ## version of certificate, gziped, JSON encoded.
The API proposal (Header already exists at common.proto)
message Header {
map<string, bytes> fields = 1;
}
message Payload {
Header header = 1;
bytes data = 2;
}
Then, for example,ActivityTaskCompletedEventAttributes change from:
message ActivityTaskCompletedEventAttributes {
bytes result = 1;
int64 scheduledEventId = 2;
int64 startedEventId = 3;
string identity = 4;
}
to
message ActivityTaskCompletedEventAttributes {
Payload result = 1;
int64 scheduledEventId = 2;
int64 startedEventId = 3;
string identity = 4;
}
A possible alternative that potentially reduces the size of the Payload is to use an enum instead of string for metadata key names. But having that the size of payloads measures in hundreds of kilobytes I'm not sure if it is worth the complexity.
Currently all blob payload fields do not have any associated metadata. It works only in monolithic applications, but might cause a lot of compatibility issues when Temporal is used as an asynchronous service mesh that connects multiple services. Another problem is that migrating applications from one encoding scheme to another is practically impossible while workflows are running.
The strawman solution is to change all the binary blobs to
Payload(name is up to the discussion) which includes Header field.This would allow to specify something like: this is an encrypted field with ## version of certificate, gziped, JSON encoded.
The API proposal (Header already exists at common.proto)
Then, for example,
ActivityTaskCompletedEventAttributeschange from:to
A possible alternative that potentially reduces the size of the Payload is to use an enum instead of string for metadata key names. But having that the size of payloads measures in hundreds of kilobytes I'm not sure if it is worth the complexity.