Support returning a failed ChildWorkflowFuture from interceptors

Currently, the Go SDK exposes the workflow.ChildWorkflowFuture interface publicly, but all concrete implementations are internal. This prevents returning a failed ChildWorkflowFuture from a custom workflow outbound interceptor, e.g., to block child workflow scheduling based on input validation.

Use case:
I’m using interceptors to enforce security restrictions and prevent sensitive data from being passed to child workflows. I want to intercept ExecuteChildWorkflow, inspect the arguments, and block execution early by returning an error — just as we can with workflow.Future for activities.

Problem:
There is no public constructor or implementation of ChildWorkflowFuture, and any attempt to implement it manually results in errors due to missing methods like SignalChildWorkflow, IsReady, etc., which are tied to internal SDK constructs.

Is it possible to expose a public function such as:

workflow.NewFailedChildWorkflowFuture(ctx workflow.Context, err error) workflow.ChildWorkflowFuture

This would allow users to fail fast from an interceptor without triggering the child workflow execution path.

Edit: I’m currently using sdk-go v1.30.1

1 Like