Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Feature Request] Support signaling with multiple message types from CLI and UI #833

@orc-jpad

Description

@orc-jpad

Is your feature request related to a problem? Please describe.

I have a signal definition that takes in two parameters/args that are of two different message types. Currently, both the Temporal UI and CLI do not support this:

  • Temporal UI accepts the signal, but it is dropped by the Temporal Worker saying only 1 parameter was specified
    • The Temporal UI does warn that only single payloads are accepted
    • exception
      System.InvalidOperationException: Signal MySignalWithTwoParams given 1 parameter(s), but more than that are required by the signature
      at Temporalio.Worker.WorkflowInstance.DecodeArgs(MethodInfo method, RepeatedField`1 payloads, String itemName, Boolean dynamic, String dynamicArgPrepend)
      at Temporalio.Worker.WorkflowInstance.<>c__DisplayClass165_0.<<ApplySignalWorkflow>b__1>d.MoveNext()
      
  • Temporal CLI accepts the signal, but it is dropped by the Temporal Worker saying it cannot decode one of the parameters (specified messageType twice - it takes the last one passed)
    Failed decoding signal args for {SignalName}, dropping the signal","exception.message":"Signal MySignalWithTwoParams had failure decoding parameters","exception.stacktrace":"System.InvalidOperationException: Signal MySignalWithTwoParams had failure decoding parameters\n ---> System.ArgumentException: Payload has protobuf message type protos.v1.bar but given type's message type is {desc.FullName}\n
    

Describe the solution you'd like

I would like the Temporal UI and CLI to support sending signals that take in parameters with different message types

  • Temporal UI example
    Image
  • Temporal CLI
    temporal workflow signal `
      --workflow-id "MyWorkflow" `
      --type "MySignalWithTwoParams" `
      --input '{ \"foo\": \"foo\" }' `
      --input '{ \"bar\": \"bar\" }' `
      --input-meta "encoding=json/protobuf" `
      --input-meta "messageType=protos.v1.foo"
      --input-meta "messageType=protos.v1.bar"

Additional context

We used two message types for reusability among different workflows and signals.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions