Skip to content

Commit fc34a31

Browse files
Update src/modules/Elsa.Workflows.Api/Endpoints/ActivityExecutions/GetCallStack/Endpoint.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 61e96f2 commit fc34a31

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

  • src/modules/Elsa.Workflows.Api/Endpoints/ActivityExecutions/GetCallStack

src/modules/Elsa.Workflows.Api/Endpoints/ActivityExecutions/GetCallStack/Endpoint.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,16 @@ public override async Task HandleAsync(Request request, CancellationToken cancel
3737

3838
if (take > maxTake)
3939
take = maxTake;
40-
var result = await store.GetExecutionChainAsync(id, includeCrossWorkflowChain, skip, take, cancellationToken);
41-
42-
if (result.TotalCount == 0)
40+
// First, check if the activity execution exists.
41+
var activityExecution = await store.FindAsync(id, cancellationToken);
42+
if (activityExecution == null)
4343
{
4444
await Send.NotFoundAsync(cancellationToken);
4545
return;
4646
}
4747

48+
// Then, get the execution chain. An empty chain should result in 200 with an empty items array.
49+
var result = await store.GetExecutionChainAsync(id, includeCrossWorkflowChain, skip, take, cancellationToken);
4850
var response = new Response
4951
{
5052
ActivityExecutionId = id,

0 commit comments

Comments
 (0)