Opening RSC Flow Docs

Connection lost
RSC Flow 1
RSC+ developer platform

Automate every live moment.

RSC Flow turns RSC+ events into secure, predictable webhook requests. This complete reference covers syntax, typed values, event payloads, delivery, testing, troubleshooting, and production safeguards.

Your first integration

Create a coded integration in Studio, paste this program, choose an event, add an HTTPS endpoint, then validate and save.

Event relay
RSCFLOW 1
METHOD POST
HEADER X-Team = "RSC+"
REQUIRE data.title
SET event = event
SET title = data.title
SET payload = data
Every program begins with RSCFLOW 1. Statements run from top to bottom. The final body is serialized as JSON and signed when a signing secret is configured.

Seven statements, clear behavior

RSC Flow is line oriented. Blank lines and lines beginning with # are ignored. Values can be variable paths, JSON strings, objects, arrays, numbers, booleans, or null.

StatementBehavior
RSCFLOW 1Declares language version 1. It must be the first real statement.
METHOD POSTSets POST, PUT, or PATCH. POST is the default.
HEADER Name = valueAdds a safe custom request header.
REQUIRE data.titleStops delivery when a required value is missing.
SET output.path = valueWrites a typed value into the JSON body.
PUSH output.list = valueAppends a value to an output array.
BODY valueReplaces the complete request body.

Built-in variables

Use variable paths directly to preserve their type. Use {{path}} inside a quoted string or JSON value to interpolate text.

VariableMeaning
eventThe event name, such as video.published.
createdAtThe event timestamp in ISO 8601 format.
sourceThe source identifier, currently rsc-plus.
dataThe complete event payload as an object.
data.titleA nested field from the event payload.
integration.idThe connected integration identifier.
integration.nameThe integration name from Studio.

Connect to the platform

Choose one event in Studio or select all events. Test deliveries use sample data so you can verify the request before it reaches production.

broadcast.created

Delivered when this RSC+ platform action completes.

broadcast.ended

Delivered when this RSC+ platform action completes.

video.published

Delivered when this RSC+ platform action completes.

short.published

Delivered when this RSC+ platform action completes.

short.ad.impression

Delivered when this RSC+ platform action completes.

announcement.published

Delivered when this RSC+ platform action completes.

ad.forced

Delivered when this RSC+ platform action completes.

effect.triggered

Delivered when this RSC+ platform action completes.

platform.maintenance

Delivered when this RSC+ platform action completes.

Common patterns

These programs are ready to paste into Integration Studio. Change the endpoint and wording to match your workflow.

Discord message
RSCFLOW 1
METHOD POST
REQUIRE data.title
BODY {"content":"New on RSC+: {{data.title}}"}
Nested fields and arrays
RSCFLOW 1
METHOD PATCH
SET event_name = event
SET story.title = data.title
PUSH tags = "sports"
PUSH tags = data.slug
Legacy JSON recipe
{"method":"POST","headers":{"X-Team":"RSC+"},"body":{"event":"{{event}}","payload":"{{data}}"}}

Values and JSON types

RSC Flow values are typed. Direct variable paths preserve their original type. Interpolation inserts text into a string or JSON structure.

SyntaxResult
"Championship"String literal
1284Number literal
true or falseBoolean literal
nullNull literal
{"status":"ready"}JSON object literal
["live","sports"]JSON array literal
data.titleVariable path that preserves its type
"Published: {{data.title}}"Interpolated text
{"title":"{{data.title}}"}Interpolated JSON
Version 1 grammar
program   = version, statement*
version   = "RSCFLOW 1"
statement = method | header | require | set | push | body
method    = "METHOD " ("POST" | "PUT" | "PATCH")
header    = "HEADER " name " = " value
require   = "REQUIRE " variable_path
set       = "SET " output_path " = " value
push      = "PUSH " output_path " = " value
body      = "BODY " value
value     = variable_path | JSON value | interpolated JSON
Use SET payload = data to forward the complete typed data object. Using "{{data}}" turns the value into text.

Execution model

Statements run from top to bottom and build one outgoing request. The order is deterministic, so the same event and program produce the same request.

1. Read context

The event envelope supplies event, createdAt, source, data, and integration values.

2. Check requirements

REQUIRE stops the delivery when an essential path is missing, null, or empty.

3. Build headers

HEADER evaluates safe custom metadata without replacing protected transport headers.

4. Build the body

SET writes fields, PUSH appends arrays, and BODY replaces the complete result.

Order and nesting
RSCFLOW 1
METHOD PATCH
SET notification.kind = event
SET story.title = data.title
SET story.is_live = false
PUSH story.tags = "rsc-plus"
PUSH story.tags = data.slug
SET metrics.views = 1284
BODY replaces the complete outgoing body. Put it last when it is the final result, or place it before later SET and PUSH statements only when it produces an object.

Event envelope and payloads

Every trigger uses the same outer envelope. Event-specific fields live inside data. Integrations should ignore unknown fields so new platform data remains backward compatible.

Representative event
{
  "id": "evt_01JABC123",
  "event": "video.published",
  "createdAt": "2026-08-12T18:42:00.000Z",
  "source": "rsc-plus",
  "data": {
    "id": "video_782",
    "title": "Championship Replay",
    "slug": "championship-replay",
    "status": "published",
    "views": 1284
  }
}
EventCommon data
broadcast.createdBroadcast ID, title, status, and Cloudflare Live input details.
broadcast.endedBroadcast ID, title, status, and recording details.
video.publishedVideo ID, title, slug, status, and views.
short.publishedShort ID, title, slug, creator, and category.
short.ad.impressionCampaign ID, title, placement, and impression data.
announcement.publishedAnnouncement ID, title, message, and severity.
ad.forcedCampaign ID, title, duration, and placement.
effect.triggeredEffect ID, message, subtitle, and duration.
platform.maintenanceAccess state, title, message, and automatic reopen time.

Delivery and response behavior

RSC+ sends compact JSON to the configured public HTTPS endpoint. A healthy receiver returns any 2xx status quickly, then performs slower work in its own queue.

Representative request
POST /rsc/events HTTP/1.1
Content-Type: application/json
X-RSC-Event: video.published
X-RSC-Delivery: evt_01JABC123
X-RSC-Signature-256: sha256=6d4c...
X-RSC-Automation: studio
Content type

Bodies use application/json with UTF-8 encoding.

Event header

X-RSC-Event identifies the trigger before the body is parsed.

Delivery identity

Use the delivery ID for logs and duplicate protection.

Successful response

Return a 2xx status when the event has been accepted.

Complete body replacement
RSCFLOW 1
METHOD PUT
REQUIRE data.id
BODY {"type":"{{event}}","resource":{"id":"{{data.id}}","title":"{{data.title}}"},"sent_at":"{{createdAt}}"}

Validate, test, then activate

Validation compiles the program with sample data and previews the request. Testing sends a real request to the saved endpoint.

Validate syntax

Resolve every line-specific error before saving.

Inspect the preview

Check the method, headers, body nesting, and JSON types.

Send a test

Confirm the destination logs contain the expected request.

Monitor production

Review the last delivery state after the first real event.

Receivers should be idempotent. Processing the same logical event again should not create duplicate posts, graphics, or records.

Error reference

Validation errors identify program problems before delivery. HTTP errors mean the program compiled but the destination rejected or failed the request.

MessageWhat to check
Begin the script with RSCFLOW 1The required version line is missing.
Unsupported RSC Flow versionOnly version 1 is currently accepted.
Unknown RSC Flow statementCheck the keyword, spacing, output path, and equals sign.
Expected a valueA HEADER, SET, PUSH, or BODY statement has no value.
Invalid JSON valueA string, object, or array contains invalid JSON syntax.
Required variable is missingREQUIRE could not find its value in the current event.
PUSH target is not an arrayA previous SET created a non-array value at the same path.
Unsafe output pathThe path contains a protected JavaScript object property.
Endpoint must use HTTPSOnly public HTTPS destinations can be saved.
Delivery returned HTTP errorThe endpoint responded without a successful 2xx status.

Language and delivery limits

RSC Flow is intentionally small. It cannot execute arbitrary code, access storage, read secrets, or make additional network requests.

LimitCurrent value
Language versionRSC Flow 1
Program length12,000 characters
Executable statements120 per program
Custom headersUp to 20 safe headers
Header value500 characters after interpolation
HTTP methodsPOST, PUT, and PATCH
DestinationsPublic HTTPS endpoints only

Frequently asked questions

Quick answers for common integration design decisions.

Webhook or RSC Flow?

Use a standard webhook for the complete envelope. Use RSC Flow for a custom body or headers.

Can I use Discord or Slack?

Yes. Use an incoming webhook URL and one of the recipes in this guide.

Can one program call two endpoints?

No. Create a separate integration for each destination.

Can I add Authorization?

No. Use the HMAC signature or a safe destination-specific custom header.

What if a variable is missing?

It resolves to an empty value. Use REQUIRE to stop delivery instead.

Do comments count as statements?

No. Blank lines and full comment lines are ignored.

Can I loop over arrays?

Version 1 has no loops. PUSH creates arrays and direct paths can forward existing arrays.

Will version 1 change?

Its behavior is fixed. Future syntax will require a new version declaration.

Safe by design

RSC Flow does not use eval, dynamic functions, filesystem access, or arbitrary network calls. It only builds the request sent to the HTTPS endpoint configured in Studio.

Signed delivery

Set a secret to receive X-RSC-Signature-256 with an HMAC SHA-256 signature.

Protected headers

Host, authorization, cookies, connection, content length, event, and signature headers cannot be overwritten.

Bounded programs

Source is limited to 12,000 characters and 120 executable statements.

Public HTTPS only

Integration endpoints must use HTTPS and cannot target local or private network addresses.

For signature verification, compute HMAC SHA-256 over the raw request body and compare it with the value after sha256= in the signature header.