1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = { "request": {
9 "entity_id": "order-42",
10 "evaluation_time": "2026-10-18T08:00:00Z",
11 "sources": [
12 { "id": "stripe" },
13 { "id": "crm" },
14 { "id": "warehouse" },
15 ],
16 "fields": {
17 "payment": {
18 "source_priority": [
19 "stripe",
20 "crm",
21 ],
22 "max_age_seconds": 3600,
23 "min_confidence": 0.8,
24 "require_provenance": True,
25 "allowed_values": [
26 "paid",
27 "refunded",
28 ],
29 "tie_break": "ABSTAIN",
30 },
31 "fulfillment": {
32 "source_priority": ["warehouse"],
33 "max_age_seconds": 3600,
34 "min_confidence": 0.8,
35 "require_provenance": True,
36 "allowed_values": [
37 "shipped",
38 "held",
39 ],
40 "tie_break": "ABSTAIN",
41 },
42 },
43 "observations": [
44 {
45 "id": "a",
46 "entity_id": "order-42",
47 "source_id": "stripe",
48 "field": "payment",
49 "value": "refunded",
50 "observed_at": "2026-10-18T07:55:00Z",
51 "confidence": 0.98,
52 "provenance": "stripe:event-a",
53 },
54 {
55 "id": "b",
56 "entity_id": "order-42",
57 "source_id": "crm",
58 "field": "payment",
59 "value": "paid",
60 "observed_at": "2026-10-18T07:59:00Z",
61 "confidence": 0.99,
62 "provenance": "crm:event-b",
63 },
64 {
65 "id": "c",
66 "entity_id": "order-42",
67 "source_id": "warehouse",
68 "field": "fulfillment",
69 "value": "shipped",
70 "observed_at": "2026-10-18T07:58:00Z",
71 "confidence": 0.95,
72 "provenance": "warehouse:event-c",
73 },
74 ],
75 "invariants": [],
76 } }
77
78
79run = client.actor("bono718/agent-state-conflict-resolver").call(run_input=run_input)
80
81
82print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
83for item in client.dataset(run.default_dataset_id).iterate_items():
84 print(item)
85
86