Skip to content

Feat cross app wf#26

Merged
JoshVanL merged 15 commits into
dapr:mainfrom
cicoyle:feat-cross-app-wf
Jul 2, 2025
Merged

Feat cross app wf#26
JoshVanL merged 15 commits into
dapr:mainfrom
cicoyle:feat-cross-app-wf

Conversation

@cicoyle

@cicoyle cicoyle commented Jun 18, 2025

Copy link
Copy Markdown

expose cross app functionality in durabletask and update contributing docs with how to update protos

Implementation for this proposal

cicoyle added 8 commits June 16, 2025 14:46
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
@cicoyle cicoyle marked this pull request as draft June 19, 2025 22:24
@cicoyle cicoyle marked this pull request as ready for review June 20, 2025 19:26
@cicoyle cicoyle requested a review from JoshVanL June 23, 2025 15:43
Comment thread backend/executor.go Outdated
Comment thread backend/executor.go Outdated
Comment thread backend/executor.go Outdated
Comment thread backend/runtimestate/runtimestate.go Outdated
Comment thread backend/runtimestate/runtimestate.go Outdated
Comment thread task/activity.go Outdated
type callActivityOptions struct {
rawInput *wrapperspb.StringValue
retryPolicy *RetryPolicy
AppID string

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this AppID and not Target or similar?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left the OrchestrationCtx AppID as-is, and did not change it to sourceAppID. I did however change this to be targetAppID. I prefixed it with target to be clear its the target, not a source per say, but also left AppID to be clear what the 'target' is.

As of now its used like:

err := ctx.CallActivity("ProcessData",
			task.WithActivityInput(input),
			task.WithAppID(appID2)).
			Await(&output)

lmk if you think it would be clearer to use task.WithTargetAppID(appID2)) or task.OnAppID(appID2) instead

Comment thread task/activity.go Outdated
Comment thread task/orchestrator.go Outdated
Comment thread task/orchestrator.go
Comment on lines +204 to +207
// Extract source AppID from HistoryEvent Router if this is ExecutionStartedEvent
if ctx.AppID == "" && e.GetRouter() != nil && e.GetRouter().GetSource() != "" {
ctx.AppID = e.GetRouter().GetSource()
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are we doing here?

Why are we checking whether AppID is an empty string?

@cicoyle cicoyle Jul 1, 2025

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tweaked the if statement, but I assigned ctx.AppID during the ExecutionStarted event because that’s when we can be sure we’re handling the current orchestration — not a parent or child in the call stack.

While router metadata is technically available on every history event, setting AppID earlier (for ex: in NewOrchestrationContext()) could be misleading in the presence of sub-orchestrations. To do that cleanly, I’d either need to pass AppID into NewOrchestrationContext (which would require changes across multiple ExecuteOrchestrator implementations in backend/orchestration.go, client/worker_grpc.go, and azurefunc/middleware.go) or scan through oldEvents and newEvents, which felt fragile and error-prone.

Open to suggestions if there's a cleaner place you think it belongs — happy to tweak!

Comment thread task/orchestrator.go Outdated
cicoyle added 2 commits June 30, 2025 22:29
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
@cicoyle cicoyle requested a review from JoshVanL July 1, 2025 03:45
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Comment thread backend/executor.go Outdated
Comment thread task/orchestrator.go Outdated
Comment thread task/orchestrator.go Outdated
Comment thread task/orchestrator.go Outdated
Comment thread task/orchestrator.go Outdated
cicoyle added 4 commits July 1, 2025 15:41
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
@JoshVanL JoshVanL merged commit f898d61 into dapr:main Jul 2, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants