{"id":15441143,"url":"https://github.com/zdenham/cronked","last_synced_at":"2025-03-28T06:45:05.681Z","repository":{"id":48028119,"uuid":"336856866","full_name":"zdenham/cronked","owner":"zdenham","description":"An API to schedule webhooks--serverless alternative to cron","archived":false,"fork":false,"pushed_at":"2021-08-10T20:47:32.000Z","size":141,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-18T12:18:06.697Z","etag":null,"topics":["cron","scheduler","serverless"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zdenham.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-07T18:16:24.000Z","updated_at":"2023-01-03T14:58:56.000Z","dependencies_parsed_at":"2022-08-12T17:00:55.065Z","dependency_job_id":null,"html_url":"https://github.com/zdenham/cronked","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zdenham%2Fcronked","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zdenham%2Fcronked/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zdenham%2Fcronked/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zdenham%2Fcronked/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zdenham","download_url":"https://codeload.github.com/zdenham/cronked/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245984556,"owners_count":20704794,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cron","scheduler","serverless"],"created_at":"2024-10-01T19:16:50.486Z","updated_at":"2025-03-28T06:45:05.664Z","avatar_url":"https://github.com/zdenham.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cronked\n\nCronked is an API to schedule recurring tasks via webhooks. It's particularly useful as an alternative to cron for distributed or serverless applications. Cronked exposes a simple http API on top of two battle tested frameworks: [redis](https://github.com/redis/redis) and [bullmq](https://github.com/taskforcesh/bullmq).\n\n## Why Cronked?\n\nOriginally, I was using CloudWatch Events for a similar use case (scheduling recurring hooks), but CWE maxes out at 5k rules. If you need to schedule a significant number of recurring jobs, you'll need to roll your own solution: hence, Cronked. The Cronked API is also fully open sourced and trivial to deploy and consume, requiring far less tinkering than CWE and other options to get up and running!\n\n## Schedule Your First Sequence\n\nThe following will schedule a recurring `POST` request to 'https://example.com/api/path' with the specified body every 10 seconds (after a 5 second delay) until the hook has been called 10 times.\n\n```\ncurl --request POST \\\n  --url https://cronked.herokuapp.com/v1/hooks \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n    \"delay\": 5000,\n    \"every\": 10000,\n    \"limit\": 10,\n    \"hookUrl\": \"https://example.com/api/path\",\n    \"hookBody\": {\n      \"optional_key\": \"optional_value\"\n    }\n  }'\n```\n\n## API\n\nFor now, there is just one endpoint: a `POST` request to `/v1/hooks`\n\n**Request Body**\n| Key |Type |Description |\n|----------------|-------------------------------|-----------------------------|\n|hookUrl | String | The url which will be posted to by cronked |\n|delay? |Number |Time in MS before firing first Webhook |\n|every? |Number |Interval in MS for hook to fire. **Note** cannot be used with 'cron'. |\n|limit? |Number |Maximum number of times the hook will fire |\n|cron? |String |Cron expression which specifies when to fire the webhook using [cron-parser](https://github.com/harrisiirak/cron-parser)'s \"unix cron w/ optional seconds\" format. **Note** cannot be used with 'every'.|\n|hookBody?|Object |Optional body to be passed by the web hook|\n\n## Development\n\nIn dev, both the cronked Server and Worker will run concurrently and interact with your local redis server.\n\n```\ngit clone https://github.com/zdenham/cronked.git\ncd cronked\nyarn install\nyarn dev\n```\n\n**Note**: Redis must be running locally for the dev environment to work, you can see instructions to get redis up and running [here](https://redis.io/topics/quickstart).\n\nAlternatively, to run a containerized version of cronked and redis, simply run `docker-compose up --build`.\n\nThe server will be made available at http://localhost:3500\n\n## Deploy Your Own Instance\n\nThe quickest \u0026 scrappiest way to deploy Cronked is via the [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli). For simplicity you can run the worker and server concurrently on the same node and utilize Heroku's Redis add on. Here are some deployment instructions to get up and running:\n\n1. `git clone https://github.com/zdenham/cronked.git \u0026\u0026 cd cronked`\n2. `heroku login`\n3. `heroku apps:create [app_name]`\n4. Navigate to https://dashboard.heroku.com \u003e [app_name] \u003e Resources\n5. In the add ons section, search \"Heroku Redis,\" select the add on and confirm\n6. `heroku git:remote -a [app_name]`\n7. `git push heroku main`\n\n## TODO\n\n- [ ] Authentication\n- [ ] `GET` endpoint to see current status of a sequence by webhook ID\n- [ ] `DELETE` endpoint to cancel a given sequence\n- [ ] Specify logic around webhook retries / failures\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzdenham%2Fcronked","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzdenham%2Fcronked","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzdenham%2Fcronked/lists"}