A minimal example that, on a cron schedule, reads a value from an AWS S3 object, increments it, and writes it back using CRE (Chainlink Runtime Environment) with SigV4-signed HTTP requests.
The workflow:
- Retrieves AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY from CRE Secrets
- Signs the request with AWS SigV4 (timestamp from consensus runtime)
- Reads the S3 object (initializes to 0 if missing)
- Aggregates the current value across nodes (median), increments once, writes the agreed next value back
Setup: Add AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY as CRE secrets (or env for local testing). Configure my-workflow/config.json: schedule (6-field cron), aws_region, s3_bucket, s3_key (e.g. cre-counter.txt).
Run: cre workflow simulate my-workflow
Example output: OldValue, NewValue in JSON.