# if.api demo — Pipedream automation resolver (receipt-backed)

**Audience:** external reviewers + operators  
**Reality gate:** demo of a transformation contract, not a deployed Pipedream integration.

---

## Links (HTML-first)

if.trace receipt:
https://infrafabric.io/static/trace/8xH7cfKib0TFAil7tZhvmQ

Pack (HTML view):
https://infrafabric.io/static/pack/8xH7cfKib0TFAil7tZhvmQ

Pack (raw Markdown):
https://infrafabric.io/static/pack/8xH7cfKib0TFAil7tZhvmQ.md

Source bundle (tgz):
https://infrafabric.io/static/source/64097e022411e7551a49127eaaeeadf389306da6a454b469c4c1678e5b77e34f.tgz

---

## What this proves (black/white)

This demo proves:
- a known Pipedream workflow definition can be transformed deterministically into a normalized event envelope
- the output is bound to if.trace receipts (hash checks; signatures only where present and verifiable)

This demo does not prove:
- live Pipedream API calls, OAuth scopes, or workflow execution
- any shipped if.bus runtime or message broker

---

## Demo artifacts

Source bundle sha256 (tgz):

    64097e022411e7551a49127eaaeeadf389306da6a454b469c4c1678e5b77e34f

Input JSON sha256:

    f2ba1e6c0f68a48522539309b515e650935b845d92ca1ba64bfa8b36e0a1b676

Normalized output JSON sha256:

    8f078a4f8272ba6907c77e7dd578abcea64090050d7f40d4f5d0b0bf58a49c4e

---

## How to reproduce (no internal access)

```bash
curl -fsSL -o if-api-pipedream-demo-source.tgz "https://infrafabric.io/static/source/64097e022411e7551a49127eaaeeadf389306da6a454b469c4c1678e5b77e34f.tgz"
sha256sum if-api-pipedream-demo-source.tgz

tar -xzf if-api-pipedream-demo-source.tgz
python3 resolve_pipedream_demo.py pipedream_input.json > resolved_event.json
sha256sum resolved_event.json
```

Expected `sha256sum` (source bundle):

    64097e022411e7551a49127eaaeeadf389306da6a454b469c4c1678e5b77e34f  if-api-pipedream-demo-source.tgz

Expected `sha256sum` (normalized output):

    8f078a4f8272ba6907c77e7dd578abcea64090050d7f40d4f5d0b0bf58a49c4e  resolved_event.json

---

## Output (normalized event envelope)

```json
{
  "event": "resolve",
  "input_sha256": "f2ba1e6c0f68a48522539309b515e650935b845d92ca1ba64bfa8b36e0a1b676",
  "integration": "pipedream",
  "notes": {
    "integrity": "see if.trace receipt for output bytes",
    "live_lookup": false
  },
  "requested_at": "2026-01-07T00:00:00Z",
  "resolved_at": "2026-01-07T00:00:00Z",
  "results": [
    {
      "metadata": {
        "action": "slack.post_message",
        "owner": "demo.builder@example.com",
        "status": "enabled",
        "trigger": "github.push"
      },
      "resolution_method": "synthetic-map",
      "status": "resolved",
      "target_url": "https://pipedream.com/workflows/wf_9001",
      "workflow_id": "wf_9001"
    },
    {
      "metadata": {
        "action": "google.sheets.append_row",
        "owner": "demo.builder@example.com",
        "status": "paused",
        "trigger": "google.drive.new_file"
      },
      "resolution_method": "synthetic-map",
      "status": "resolved",
      "target_url": "https://pipedream.com/workflows/wf_9002",
      "workflow_id": "wf_9002"
    }
  ],
  "schema_version": "demo.v1"
}
```
