actions / actions/starter-workflows

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

Open
#3,183 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

The issue body contains only a TypeScript Cloudflare Workers workflow snippet and no requested change, target file, or test. First determine whether this is intended for actions/starter-workflows or the linked original issue; no completion criteria can be established from this issue alone.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, typescript
Domain
ci-cd, devops
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
10/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.