Перейти к содержанию
НОВОЕМаркетплейс и trig8n Agent: продавайте то, что создали, и получайте планы и изменения, проверенные до того, как вы их увидите. Что нового

Библиотека / Код, Git и инструменты разработчика

Код, Git и инструменты разработчика

Восстановление рабочих процессов n8n из слитых pull request в GitHub

Когда в GitHub выполняется слияние pull request, получает сведения о коммите и восстанавливает изменённые рабочие процессы в n8n через API.

Что делает

## Setup 1. Connect GitHub: Use the GitHub Trigger node and configure GitHub API credentials. Note: I'd recommended to use *GitHub PAT (Personal Access Token) classic* with repo and admin:repo_hook permission scopes enabled. 2. Connect n8n API: Provide your n8n API credentials in the n8n nodes. - Check this doc 3. Set repository variables: Update github_owner and repo_name in the Define Local Variables node. 4. Enable webhook: Make sure your GitHub repository has a webhook for pull_request events pointing to this workflow.

Шаги

  1. Define Local Variables
  2. Github Trigger - When there is new pull request
  3. Check if trigger event is pull request merged
  4. Fetch merged commit details via GitHub API
  5. Get files changes details
  6. Filter modified workflows
  7. Filter created workflows
  8. Fetch workflow content from Git
  9. Fetch workflow content from Git1
  10. Decode workflow content to json
  11. Decode workflow content to json1
  12. Update workflow in n8n
  13. Create new workflow in n8n

Похожие автоматизации