Azure / Azure/azure-functions-durable-powershell

Still can't seem to pass complex output to activity functions

Open
#67 1 comment 0 reactions 0 assignees View on GitHub
Enhancement Needs: Author Feedback P3
Dominant language
C#
Stars
9
Forks
14
Avg merge
1d 23h
Merged PRs (30d)
5

Description

Related Issue: https://github.com/Azure/azure-functions-durable-extension/issues/1922

If I build up a ps object with sub-objects in an orchestration function and send that to an activity function, it ends up as a hashtable on the other side:
```powershell
$InputData = [PSCustomObject]@{
Data = $Data
Documents = $Documents
SyncDataType = $SyncDataType
}
Invoke-DurableActivity -FunctionName 'Sync-DataWithDocuments' -Input $InputData
```
Maybe this is just a limitation but I want to be sure before I use workarounds. I can get it to work if I do the following:
```powershell
$InputData = [PSCustomObject]@{
Data = $Data
Documents = $Documents
SyncDataType = $SyncDataType
}
Invoke-DurableActivity -FunctionName 'Sync-DataWithDocuments' -Input ($InputData | ConvertTo-Json -Depth 100)
```
Then in the activity function
```powershell
function Sync-DataWithDocuments {
Param($Object)
$Object = $Object | ConvertTo-Json -Depth 100 | ConvertFrom-Json
}
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the shown PSCustomObject flow between the orchestration function and Sync-DataWithDocuments, comparing direct Input with the ConvertTo-Json workaround. Trace how nested values are serialized and deserialized; done means complex input retains its intended object shape, or the limitation and supported workaround are documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.