actions / actions/starter-workflows

import { WorkflowEntrypoint, WorkflowStep } from "cloudflare:workers";

Open
#3,186 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
12.1k
Forks
7.3k
PR merge metrics
No merged PRs in 30d

Description

import { WorkflowEntrypoint, WorkflowStep } from "cloudflare:workers";
import type { WorkflowEvent } from "cloudflare:workers";

type Params = { name: string };
type IPResponse = { result: { ipv4_cidrs: string[] } };

export class MyWorkflow extends WorkflowEntrypoint<Env, Params> {
async run(event: WorkflowEvent, step: WorkflowStep) {
const data = await step.do("fetch data", async () => {
const response = await fetch("https://api.cloudflare.com/client/v4/ips");
return await response.json();
});

await step.sleep("pause", "20 seconds");

const result = await step.do(
  "process data",
  { retries: { limit: 3, delay: "5 seconds", backoff: "linear" } },
  async () => {
    return {
      name: event.payload.name,
      ipCount: data.result.ipv4_cidrs.length,
    };
  },
);

return result;

}
}

Originally posted by @flynnjustin24 in https://github.com/flynnjustin24/skills-hello-github-action/issues/6#issuecomment-3813593157

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No target file, test, entry point, or requested change is identified. Start by reviewing the issue body and repository context, then clarify whether this TypeScript Cloudflare Workflow is intended as a starter workflow and where it should be added. Done requires an agreed scope and location before implementation can begin.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cloud, devops
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.