serverlessworkflow / specification

Contains the official specification for the Serverless Workflow Domain Specific Language. It provides detailed guidelines and standards for defining, executing, and managing workflows in serverless environments, ensuring consistency and interoperability across implementations.
http://serverlessworkflow.io
Apache License 2.0
732 stars 146 forks source link

Question about timeout definition in callback state #199

Closed xinydev closed 3 years ago

xinydev commented 3 years ago

What is the question:

states:
- name: CheckCredit
  type: callback
  start:
    kind: default
  action:
    functionRef:
      refName: callCreditCheckMicroservice
  eventRef: CreditCheckCompletedEvent
  timeout: PT15M
  transition:
    nextState: StartApplication
- name: StartApplication
  type: subflow
  workflowId: startApplicationWorkflowId
  end:
    kind: default

two scenarios

  1. The CreditCheckCompletedEventevent occurs within the defined timeout, the flow runs well and StartApplication is triggered.
  2. The CreditCheckCompletedEventevent does not occur within the defined timeout, the StartApplication is still triggered.

My question is how the StartApplication state knows whether the previous state is timeout or not? because we do not want call a subflow when the previous state is timeout. Is there some spec like onErrors or default in callback state?

tsurdilo commented 3 years ago

@xinydev Hello :) Yes currently you would have to handle the timeout of your CheckCredit state in its onErrors definition with which you can define a separate transition when this occurs. You can find more information about workflow error handling here: https://github.com/serverlessworkflow/specification/blob/master/specification.md#Workflow-Error-Handling Hope this helps.

tsurdilo commented 3 years ago

@xinydev can this issue be closed?