Actions5
Create Env Variable
AI-generatedSummary
Creates a single environment variable on a Vercel project via POST /v10/projects/{project}/env, once per input item, and returns Vercel's API response.
Inputs
- projectIdOrName (required) — Vercel project ID or name; URL-encoded into the request path.
- envKey (required) — Name of the environment variable.
- envValue (required) — Value of the environment variable.
- envType — Variable type: encrypted (default), secret, plain, sensitive, or system.
- envTarget — Environments to apply to: production, preview, development. Defaults to all three.
- gitBranch — Git branch to scope the variable to (typically for preview). Only sent if non-empty.
Output shape
One output item per input item, whose json is the Vercel API response for the created variable, paired to the input item.
Uses the vercelApi credential (access token, optional team ID added as the teamId query parameter, optional custom base URL). The source also reads a 'teamIdOverride' parameter (default empty) that is not in the declared properties, so the team comes from the credential. With Continue On Fail enabled, failures yield an item with json.error instead of stopping the workflow.
Examples
Example 1: Add an API_URL variable to a project for production only.
Project ID or Name: my-app; Env Var Key: API_URL; Env Var Value: https://api.example.com; Type: Plain; Target: Production.
Example 2: Store a secret scoped to a preview branch.
Project: my-app; Key: STRIPE_KEY; Value: from an expression; Type: Encrypted; Target: Preview; Git Branch: staging.
