Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions examples/child-workflows/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Deploy on Restack Cloud

RESTACK_ENGINE_ID=
RESTACK_ENGINE_ADDRESS=
RESTACK_ENGINE_API_KEY=

RESTACK_CLOUD_TOKEN=
1 change: 1 addition & 0 deletions examples/child-workflows/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
52 changes: 52 additions & 0 deletions examples/child-workflows/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Build stage
FROM node:20-bullseye AS builder

WORKDIR /app

# Install pnpm
RUN npm install -g pnpm

# Copy package files and env file if it exists
COPY package*.json .env* ./

# Copy package files
COPY package*.json ./

# Install dependencies including TypeScript
RUN pnpm install
RUN pnpm add -D typescript

# Copy source code
COPY . .

# Build TypeScript code
RUN pnpm run build

# Production stage
FROM node:20-bullseye

WORKDIR /app

# Install pnpm
RUN npm install -g pnpm

# Copy package files and built code
COPY --from=builder /app/package*.json ./
COPY --from=builder /app/dist ./dist

# Install production dependencies only
RUN pnpm install --prod

# Define environment variables
ARG RESTACK_ENGINE_ID
ENV RESTACK_ENGINE_ID=${RESTACK_ENGINE_ID}

ARG RESTACK_ENGINE_ADDRESS
ENV RESTACK_ENGINE_ADDRESS=${RESTACK_ENGINE_ADDRESS}

ARG RESTACK_ENGINE_API_KEY
ENV RESTACK_ENGINE_API_KEY=${RESTACK_ENGINE_API_KEY}

EXPOSE 3000

CMD ["node", "dist/services.js"]
30 changes: 30 additions & 0 deletions examples/child-workflows/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "sdk-example-child-workflows",
"version": "0.0.1",
"description": "Restack Child Workflows example",
"scripts": {
"dev": "tsx watch --include src src/services.ts",
"build": "tsc --build",
"schedule-workflow": "tsx scheduleWorkflow.ts",
"restack-up": "tsx restackUp.ts",
"restack-web-ui": "docker run -d --pull always --name restack -p 5233:5233 -p 6233:6233 -p 7233:7233 ghcr.io/restackio/restack:main",
"restack:up": "dotenv -e .env node restack_up.mjs",
"docker:build": "docker build -t restack-child-workflows .",
"docker:run": "docker run -d --name restack-child-workflows -p 3000:3000 restack-child-workflows"
},
"dependencies": {
"@restackio/ai": "0.0.86",
"@temporalio/workflow": "1.11.2",
"dotenv": "16.4.5",
"zod": "3.23.8",
"zod-to-json-schema": "3.23.3"
},
"devDependencies": {
"@restackio/cloud": "^1.0.19",
"dotenv-cli": "^7.4.2",
"@types/node": "20.16.9",
"prettier": "3.3.3",
"tsx": "4.19.2",
"typescript": "5.6.3"
}
}
Loading