Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invoke-DurableActivity -Input takes only objects nested max 1 level #754

Open
PawelKaczanowski7N opened this issue Feb 8, 2022 · 5 comments

Comments

@PawelKaczanowski7N
Copy link

Orchestation function:

$t1 = @{a=1;b=2}
$t2 = @{t1=$t1;c=3}
Invoke-DurableActivity -FunctionName 'Hello1' -input $t2

Hello1 function:

param($name) 
"Hello $($name | ConvertTo-Json -Depth 100) !"

Output:

OUTPUT: Hello {
[2022-02-08T14:30:20.871Z]   "t1": "System.Collections.Hashtable",
[2022-02-08T14:30:20.872Z]   "c": 3
[2022-02-08T14:30:20.873Z] } !
@kwill-MSFT
Copy link

@PawelKaczanowski7N see Azure/azure-functions-durable-extension#1922. Specifically you will want to serialize your object to JSON before sending it to the activity function:

Invoke-DurableActivity -FunctionName 'Test2' -Input ($result | ConvertTo-Json -Depth 5)

@davidmrdavid as the owner of that other issue where docs are supposed to be updated.

@PawelKaczanowski7N
Copy link
Author

It's a dirty workaround but it will work in most cases(my also), side effect is that you loose objects type as everything is converted to hashtables and arrays.

Thank you

@davidmrdavid
Copy link
Contributor

Thanks @PawelKaczanowski7N and @kwill-MSFT.

This is a tricky behavior to fix because it constitutes a breaking change, but we're aware of it and I've already included the fix in the code for the next major release of the Durable Functions for PowerShell SDK. I'm looking to release that as soon as possible, most likely in the next few months (since it's a breaking change release, it requires time). I should be able to provide more updates on this soon :)

@davidmrdavid
Copy link
Contributor

Hey @PawelKaczanowski7N, @kwill-MSFT:

The release took longer than expected on our end, my apologies for that, but this new SDK has finally been announced here. This new SDK allows us to version breaking changes properly as it's published as a standalone package in the PowerShell gallery, which means we were finally able to deal with this issue as well as several others. Just wanted to notify you all in case you were interested in giving it a try. Please note that this SDK package is currently in public preview, but the plan is to GA it fairly quickly, in time for PowerShell 7.4 support in Azure Functions. That's all, thanks!

@lilyjma
Copy link

lilyjma commented Mar 4, 2024

Hi @PawelKaczanowski7N - thank you for using Durable Functions! I'm a PM working on DF and would love to learn about your experience. If your time allows, please grab a meeting with us here. Understanding the problems you're trying to solve will help us target future development. Thanks!

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

No branches or pull requests

6 participants