With the use of External Triggers in Workflows, they seem to require trigger-specific client/id/secret to kickoff the workflow.
When I have a PowerShell script, using a tenant-level PAT, how do I switch to another access token for a specific cmdlet (New-V2024ExternalExecuteWorkflow)?
(…because I’m see an “Unauthorized” error when using an all scope PAT)
Nice. That did the trick. Looks like the environment variables take priority if they exist, above the configuration specified in environment config file.
So it was like so:
Get-Transforms # Using environment config file
$env:SAIL_BASE_URL='https://[yourTenantHere].api.identitynow.com'
$env:SAIL_CLIENT_ID='[yourClientID]'
$env:SAIL_CLIENT_SECRET='[yourClientSecret]'
New-V2024ExternalExecuteWorkflow -id xxxxx # Using env vars
Remove-Item -Path Env:SAIL_* # Wiping env vars
Get-Transforms # Using environment config file again