How okta/workflows-templates works
Project Type & Purpose
• This is an open-source template library for Okta Workflows: a GitHub repo that holds dozens of pre-built workflow “flopack” bundles plus metadata and scripts. Developers submit new workflow templates here; CI/CD validates and publishes screenshots to S3/CloudFront for end-users to import into the Okta Workflows console.
File Structure Analysis
• Top‐level files:
• .circleci/config.yml → CI pipeline
• package.json/package-lock.json → Node.js dependencies & scripts
• connectors.json → master list of allowed connector names
• workflows/ → each subfolder is a workflow template containing:
– workflow.flopack (exported bundle)
– workflow.json (metadata + details)
– readme.md (usage docs)
– optional resources/ (screenshots)
• scripts/json-details-scripts/ + scripts/schema_validate.js, scripts/validate_release.sh → CLI tools that populate and verify workflow.json details and enforce schema rules.
• tutorial/ → contributor onboarding content
README Insights
• Contributors design in the Okta Workflows console → export _flopack_ → rename and drop into a folder → add metadata (workflow.json) and readme → run validation scripts locally and push → CircleCI runs validate:schema, validate:release → on success it auto-uploads screenshots to S3 (CloudFront CDN) and merges changes.
Components
a. Source Control & Dev Environment
• Developer machines (running Node.js / npm scripts)
• GitHub repository
b. CI/CD Pipeline
• CircleCI
• Validation scripts (schema_validate.js, details_modifier.js, validate_release.sh)
c. Artifact Storage & Hosting
• AWS S3 bucket (stores screenshots under static/catalog/workflows/.../resources/...)
• AWS CloudFront distribution (serves screenshot URLs)
d. Runtime Consumer
• Okta Workflows console (pulls metadata + flopack for end users)
e. Configuration & Metadata
• connectors.json (connector whitelist)
• workflow.json files in each template folder
Relationships & Data Flow
1. Developer commits new template files → pushes branch to GitHub
2. GitHub push triggers CircleCI
3. CircleCI executes:
• npm install → pulls Node.js scripts
• scripts/schema_validate.js → verifies JSON schemas
• scripts/json-details-scripts/details_modifier.js → auto-updates details in workflow.json
• scripts/validate_release.sh → release validation
• On success, uploads resources/ screenshots to S3, invalidates/updates CloudFront cache
4. Merged changes make screenshots available at CloudFront URLs
5. End users browse the Okta Workflows catalog (metadata + screenshots pulled via CDN) and import .flopack into their tenant
Architectural Patterns & Principles
• CI/CD pipeline: automated validation, metadata generation, and asset deployment
• Separation of Concerns:
• Templates and metadata live under workflows/
• Validation/manipulation logic under scripts/
• CI orchestration in .circleci/
• Immutable artifacts: .flopack files + screenshot hashes ensure cache-busting
• Static hosting: metadata remains in Git; binary assets served via S3/CloudFront
Technologies & Frameworks
• Node.js (scripts, validation, metadata modification)
• JSON schemas for metadata (workflow.json, connectors.json)
• CircleCI (CI orchestration)
• AWS S3 & CloudFront (screenshot hosting + CDN)
• GitHub (source control)
• Okta Workflows (consumer of templates)