Skip to content

refactor(workflow): support configurable per-node timeouts and replace hardcoded 1-year activity timeout #152

Description

@lokewate

Current Limitation

In workflow/workflow.go, handleTaskNode currently hardcodes a 1-year StartToCloseTimeout:

nodeCtx := workflow.WithActivityOptions(ctx, workflow.ActivityOptions{
    ActivityID:          nodeInfo.ID,
    StartToCloseTimeout: 24 * time.Hour * 365,
})

This presents two major issues:

  • Worker Crash Masking: If a worker crashes mid-execution during a non-heartbeating task, Temporal will not detect worker failure or trigger retries for up to 1 year.
  • Lack of SLA Flexibility: All task nodes share the same hardcoded timeout regardless of whether they are fast automated tasks or long-running SLA processes.

Suggested Improvement

  • Add optional timeout configuration (timeout, start_to_close_timeout, heartbeat_timeout) to Node / TaskTemplate in dsl.go.
  • Update handleTaskNode to parse and apply per-node DSL timeouts with a sensible default fallback (e.g., default StartToCloseTimeout and optional HeartbeatTimeout).

Version

No response

Additional Context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority/HighImportant — should be resolved soonType/ImprovementEnhancement to existing functionality

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions