Did some reverse engineering of the graphql API used by the frontend workflows browser UI. Below is a powershell script that works to iterate over and extract the execution history of a specific workflow. To get the ID of your workflow, just look at the URL. And to get the ID of your org (aka workspace ID), look here. To generate/retrieve an API key for the bearer auth header look here.
Note that the hardcoded persisted query sha256 hashes likely will change as PD makes changes to their product (easy to pick out from browser dev tools). Would only recommend using this for one-time exports and not putting into any automated flow as this is an undocumented/internal API.
$graphqlUrl = "https://api.pipedream.com/graphql"
$headers = @{
"Content-Type" = "application/json"
"Authorization" = "Bearer {API_KEY}"
}
# --- STEP 1: Fetch the initial list of items ---
# Define the first GraphQL query
$initialQuery = @{
variables = @{ "orgId"="{ORG_WORKSPACE_ID}";"workflowId"="{WORKFLOW_ID}" }
extensions = @{ "persistedQuery"=@{ "sha256Hash"="5d132991c007be8a96e54b733c161730eecf6729bd90e69d2b450255997c5621";"version"=1}} # myTraceRecords
} | ConvertTo-Json -Compress
try {
# Send the first POST request
$initialResponse = Invoke-RestMethod -Uri $graphqlUrl -Method Post -Headers $headers -Body $initialQuery
# Parse and extract the array from the results
$dataArray = $initialResponse.data.my.traceRecords.nodes.id
Write-Host "Found $($dataArray.Count) items. Starting nested queries..." -ForegroundColor Cyan
# --- STEP 2: Iterate over the array and make subsequent requests ---
foreach ($execId in $dataArray) {
Write-Host "Processing: $execId" -ForegroundColor Yellow
# continue;
# Define the second GraphQL query using the ID from the current iteration
$nestedQuery = @{
variables = @{"id"=$execId;"includeTrigger"=$true;"namespaces"=$null}
extensions = @{ "persistedQuery"=@{ "sha256Hash"="95a4f663471f2e4664ca77cb3f5c48d9ef4a670d65d1544422e8d2fa63c2904d";"version"=1}} # executionTrace
} | ConvertTo-Json
# Send the nested POST request
$nestedResponse = Invoke-RestMethod -Uri $graphqlUrl -Method Post -Headers $headers -Body $nestedQuery
# Parse and process the nested results
$created = $nestedResponse.data.executionTrace.trace.create_ts
$event = $nestedResponse.data.executionTrace.trace.trigger.exports.event
[pscustomobject]@{ date=$created; body=$event.body; ip=$event.client_ip; referer=$event.headers.referer; userAgent = $event.headers.'user-agent' }
}
}
catch {
Write-Error "An error occurred: $_"
}