Skip to content

c4cCode For Coders

TypeScript-first workflow automation framework. Build type-safe procedures and workflows with zero configuration.

c4c

Quick Example

Define a Procedure

typescript
import { z } from "zod";
import type { Procedure } from "@c4c/core";

export const createUser: Procedure = {
  contract: {
    input: z.object({
      name: z.string(),
      email: z.string().email(),
    }),
    output: z.object({
      id: z.string(),
      name: z.string(),
      email: z.string(),
    }),
  },
  handler: async (input) => {
    return { id: generateId(), ...input };
  }
};

Build a Workflow

typescript
import type { WorkflowDefinition } from "@c4c/workflow";

export const userOnboarding: WorkflowDefinition = {
  id: "user-onboarding",
  name: "User Onboarding Flow",
  version: "1.0.0",
  startNode: "create-user",
  nodes: [
    {
      id: "create-user",
      type: "procedure",
      procedureName: "users.create",
      next: "send-welcome",
    },
    {
      id: "send-welcome",
      type: "procedure",
      procedureName: "emails.sendWelcome",
    },
  ],
};

Execute

bash
# Start dev server
c4c dev

# Execute procedure
c4c exec createUser --input '{"name":"Alice","email":"alice@example.com"}'

# Execute workflow
c4c exec userOnboarding

Why c4c?

vs Visual Tools (n8n, Zapier, Make)

FeatureVisual Toolsc4c
Development SpeedClick through UIType in IDE
Version ControlLimitedFull git
Type SafetyNoneFull TypeScript
TestingManualAutomated
RefactoringManualIDE support
Code ReuseLimitedFull

vs Code Frameworks (Temporal, Step Functions)

FeatureOthersc4c
Learning CurveComplex DSLsJust TypeScript
SetupConfiguration heavyZero config
OrganizationPrescribed structureAny structure
IntrospectionLimitedFull automatic
Developer ToolsCLI, SDKsEverything built-in

Philosophy

Framework shouldn't dictate architecture.

c4c embraces introspection over configuration. Organize your code the way that makes sense for your project - the framework will find your procedures and workflows automatically.

Developer experience first:

  • Type-safe everything
  • IDE refactoring support
  • Git-friendly workflows
  • Hot reload development
  • No vendor lock-in

Build workflows like code, not clicks.

Released under the MIT License.