Skip to content

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

@noaht8um

Description

@noaht8um

Related Issue: Azure/azure-functions-durable-extension#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:

$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:

$InputData = [PSCustomObject]@{
            Data = $Data
            Documents = $Documents
            SyncDataType = $SyncDataType
        }
Invoke-DurableActivity -FunctionName 'Sync-DataWithDocuments' -Input ($InputData | ConvertTo-Json -Depth 100)

Then in the activity function

function Sync-DataWithDocuments {
    Param($Object)
    $Object = $Object | ConvertTo-Json -Depth 100 | ConvertFrom-Json
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementNew feature or requestNeeds: Author FeedbackWaiting for the author of the issue to respond to a questionP3Priority 3

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions