{"id":15726791,"url":"https://github.com/usulpro/custom-flow","last_synced_at":"2026-01-20T21:33:24.846Z","repository":{"id":39026517,"uuid":"288525083","full_name":"usulpro/custom-flow","owner":"usulpro","description":null,"archived":false,"fork":false,"pushed_at":"2022-12-13T12:34:13.000Z","size":2466,"stargazers_count":2,"open_issues_count":17,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-07T07:54:29.603Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/usulpro.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":"2020-08-18T17:48:53.000Z","updated_at":"2022-10-09T12:00:41.000Z","dependencies_parsed_at":"2022-09-19T21:52:44.836Z","dependency_job_id":null,"html_url":"https://github.com/usulpro/custom-flow","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":"sanity-io/demo-custom-workflow","purl":"pkg:github/usulpro/custom-flow","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usulpro%2Fcustom-flow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usulpro%2Fcustom-flow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usulpro%2Fcustom-flow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usulpro%2Fcustom-flow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/usulpro","download_url":"https://codeload.github.com/usulpro/custom-flow/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usulpro%2Fcustom-flow/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28614610,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T18:56:40.769Z","status":"ssl_error","status_checked_at":"2026-01-20T18:54:26.653Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-10-03T22:40:37.726Z","updated_at":"2026-01-20T21:33:24.828Z","avatar_url":"https://github.com/usulpro.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# demo-custom-workflow\n\nA demonstration of a custom content publishing workflow using [Sanity](https://www.sanity.io/).\n\n![Demo of Custom Workflows](https://cdn.sanity.io/images/3do82whm/next/7b33af537679c9143e954ca601b1e73ebfb2ff48-634x356.gif)\n\n[Read blog post: “Document Actions: Workflows, Your Way”](https://www.sanity.io/blog/releasing-document-actions-workflows-your-way)\n\n## Documentation\n\n- [What’s the deal with this project?](#whats-the-deal-with-this-project)\n  - [Start a new project using this demo as boilerplate](#start-a-new-project-using-this-demo-as-a-boilerplate)\n  - [Create your custom schema definitions](#create-your-custom-schema-definitions)\n  - [Configure the custom workflow](#configure-the-custom-workflow)\n  - [Starting the development server](#starting-the-development-server)\n  - [Deployment](#deployment)\n  - [Got questions](#got-questions)\n- [Demo code reference](#demo-code-reference)\n  - [`app/components`](#appcomponents)\n  - [`app/config`](#appconfig)\n  - [`app/documentActions`](#appdocumentactions)\n  - [`app/documentBadges`](#appdocumentbadges)\n  - [`app/lib`](#applib)\n  - [`app/schema`](#appschema)\n  - [`app/scripts`](#appscripts)\n  - [`app/structure`](#appstructure)\n  - [`app/tools`](#apptools)\n\n### What’s the deal with this project?\n\nThe purpose of this repository is to provide an example of how to go about [creating a custom publishing workflow environment](https://www.sanity.io/docs/custom-workflows) using [Sanity Studio](https://www.sanity.io/docs/sanity-studio). _This is a demo and will not be maintained._ \n\n\u003e NOTE: Some of the code in this demo uses internal APIs that may change in the future. If you use this code as a starting point, and experience missing functionality, please review the changelog in this project. We recommend keeping a reference to this repo’s GitHub URL.\n\n#### Start a new project using this demo as a boilerplate\n\n\nPush [this link](https://github.com/sanity-io/demo-custom-workflow/generate) or the **Use this template** button, and follow the instructions below.\n\n\n```sh\ngit clone git@github.com:\u003cyour-username\u003e/demo-custom-workflow.git my-sanity-studio\ncd my-sanity-studio\n# customize README.md\n# customize package.json\n# then\nsanity init\n# Say “Yes” to reconfigure the studio and follow the instructions\n```\n\n#### Create your custom schema definitions\n\nEdit the schema files in `app/schema` to create the content models you need in your project. Visit the [content modelling documentation](https://www.sanity.io/docs/content-modelling) to learn about custom schemas.\n\n#### Configure the custom workflow\n\nOnce you have created the document types you need in your project, the next step is to add the custom document types to the workflow `types` configuration array in `app/config/workflow.js`.\n\n#### Starting the development server\n\nThis Sanity Studio project is run in the same manner as standard Sanity Studio projects:\n\n```sh\nnpm start\n```\n\n#### Deployment\n\nIf you want to deploy this Studio to a public URL so that editors can join your project, you may use the default Sanity hosting:\n\n```sh\nsanity deploy\n```\n\n#### Got questions?\n\nJoin our Slack community: https://slack.sanity.io/\n\n### Demo code reference\n\nThe Sanity Studio customization code is mainly stored in the `app` directory.\n\n#### `app/components`\n\nThe files in the `app/components` directory is a collection of custom React components used to render a KANBAN board, user selection inputs, workflow publishing buttons and so on.\n\n#### `app/config`\n\nThe `app/config/workflow.js` file is used to configure which document types to include in the custom workflow and the possible workflow states.\n\nThe default states are:\n\n- `Draft`\n- `In review`\n- `Require changes`\n- `Accepted`\n- `Published`\n\nIf you need other workflow states than the ones provided in this demo, you may rename and customize the contents of the `states` array. Keep in mind that it will require you to also change the logic in the document actions.\n\n#### `app/documentActions`\n\nThis demo is made to showcase [Sanity’s _Document actions API_](https://www.sanity.io/docs/document-actions-api). This API enables the customization of the buttons in the footer drawer of the document editing environment in the Sanity Studio.\n\nIn `app/documentActions/index.js` you’ll find the document actions resolver function, and the custom actions used for the workflow implementation are placed in the `app/documentActions/workflow` directory.\n\nIf you want to disable the custom document actions, then remove the document action resolver configuration from the `parts` array in `sanity.json`:\n\n```json\n  \"parts\": [\n    {\n      \"implements\": \"part:@sanity/base/document-actions/resolver\",\n      \"path\": \"app/documentActions\"\n    }\n  ]\n```\n\n#### `app/documentBadges`\n\n[The _Document badges API_](https://www.sanity.io/docs/custom-document-badges) is related to the document actions, and is a way to customize the document status badges in the editing environment.\n\n```json\n  \"parts\": [\n    {\n      \"implements\": \"part:@sanity/base/document-badges/resolver\",\n      \"path\": \"app/documentBadges\"\n    }\n  ]\n```\n\nIf you want to disable the custom document badges, then remove the document badge resolver configuration from the `parts` array in `sanity.json`:\n\n#### `app/lib`\n\nThis demo application requires some functionality that is not provided by the Sanity Studio out of the box.\n\n- `app/lib/document`  \n  React hooks and observables that are used to subscribe to real-time updates on workflow documents in this demo.\n- `app/lib/project`\n  React hooks and observables that are used to subscribe to real-time updates on the Sanity project – mainly which users are part of the project.\n- `app/lib/router`\n  The router provider is used to give easier access to the Sanity router context value, and for creating internal links more easily.\n- `app/lib/user`\n  React hooks used to stream user info and lists of user IDs that are used in this demo.\n- `app/utils`\n  Utility functions.\n- `app/workflow`\n  React hooks that make it easier to work with the workflow metadata documents.\n\n#### `app/schema`\n\nThe schema definitions used in this demo.\n\n```json\n  \"parts\": [\n    {\n      \"name\": \"part:@sanity/base/schema\",\n      \"path\": \"app/schema\"\n    }\n  ]\n```\n\n#### `app/scripts`\n\nScripts used while developing this demo.\n\n#### `app/structure`\n\nThe Structure configuration used in this demo.\n\n```json\n  \"parts\": [\n    {\n      \"name\": \"part:@sanity/desk-tool/structure\",\n      \"path\": \"app/structure\"\n    }\n  ]\n```\n\n#### `app/tools`\n\nThe `app/tools/board.js` is the root configuration for the KANBAN tool in this demo. It is referenced in the `sanity.json` configuration file:\n\n```json\n  \"parts\": [\n    {\n      \"implements\": \"part:@sanity/base/tool\",\n      \"path\": \"app/tools/board\"\n    }\n  ]\n```\n\n\n## Development\n\n```sh\ngit clone git@github.com:sanity-io/demo-custom-workflow.git\ncd demo-custom-workflow\nnpm install\n\n# Start the development server\nnpm start\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusulpro%2Fcustom-flow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fusulpro%2Fcustom-flow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusulpro%2Fcustom-flow/lists"}