Facebook Configuration
Dependency registration, HTTP clients, and rate-limit handling
Registration
FacebookExecutorDependency.RegisterDefaults(services) registers everything the node needs:
FacebookServicesExtensions.AddFacebookServices()— typedHttpClients for each resource service, the shared rate-limit handler, and the webhook signature validator- The executor itself (
FacebookNodeExecutor), scoped - The
ExecutorRegistryentry forfacebook
Plugins_RegisterAllNodes(...) in ServiceCollectionExtensionsForAI.cs) so the
facebook node type is discoverable at runtime and appears in the workflow designer.
HTTP Clients
Each resource service gets its own named HttpClient, all sharing the same rate-limit
handler:
| Service | Timeout | Backs Resource |
|---|---|---|
FacebookPageService | 30s | page |
FacebookPostService | 30s | post |
FacebookMessageService | 30s | message |
FacebookReactionService | 30s | reactions |
FacebookModerationService | 30s | moderation |
FacebookMediaService | 120s | media (longer timeout for photo/video upload calls) |
Rate-Limit Handler
FacebookRateLimitHandler is attached as a DelegatingHandler on every one of
the clients above. On any HTTP 429 or 5xx response, it automatically retries — up to 3
times, honoring the Graph API's Retry-After header when present and capping the
wait at 60 seconds otherwise. Request bodies are cloned before each retry so POST/upload
calls resend correctly.
API Endpoint
All requests target a fixed, versioned Graph API base URL:
https://graph.facebook.com/v25.0
This is a compile-time constant (FacebookHttpHelper.ApiBase) — there is no per-environment
or per-network override, unlike a blockchain node's mainnet/testnet split. Every call goes to the live
Graph API.
Project Layout
The node ships as three .NET 9 projects:
| Project | Responsibility |
|---|---|
BizFirst.Integration.Facebook.Domain |
Sealed result records per operation, the webhook payload model, and Graph API response shapes. Zero external dependencies. |
BizFirst.Integration.Facebook.Services |
One service per resource (page/post/message/reactions/moderation/media), the shared HTTP helper, rate-limit handler, input validator/normalizer, cursor paginator, and webhook signature validator. |
BizFirst.Ai.ExecutionNodes.Social.Facebook |
The executor: operation routing, config/credential handling, and per-operation info DTOs. |