Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

send notification once a stage has finished #69

Open
1 task
PythonFZ opened this issue May 9, 2024 · 5 comments
Open
1 task

send notification once a stage has finished #69

PythonFZ opened this issue May 9, 2024 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@PythonFZ
Copy link
Member

PythonFZ commented May 9, 2024

It would be handy to get some information once a stage has successfully finished.
This could include

  • email
  • discord
  • slack
  • mattermost
  • ...

The configuration should be handled via a file, e.g. .zntrack/config.yaml with a notification section.

  • find a suitable notification package
@PythonFZ PythonFZ added the enhancement New feature or request label May 9, 2024
@MrJulEnergy
Copy link

Sending an EMail seems to be a dead an since we either need to use an existing EMail account (for example gmail) and then store a password and username somewhere, or alternativly host our own smtp server, which isnt as simple as it sounds

@MrJulEnergy
Copy link

zincware/ZnTrack#797 Tries to add a method of storing sensitive data

@MrJulEnergy
Copy link

MrJulEnergy commented May 9, 2024

I wrote the following Node which can send an Notification to a Discord server when given an webhook_url. Note that zntrack.local_config() isnt currently implemented in ZnTrack

class NotifyMe(zntrack.Node):
    webhook_url = zntrack.local_config()
    previus_node = zntrack.deps()

    def run(self):
            try:
                node_name = self.previus_node.name
                time = datetime.now().strftime("%H:%M:%S")
                day = datetime.now().strftime("%B %d. %Y")
                msg = {"content": f"Your Workflow has reached {node_name} at {time} on {day}!"}
            except AttributeError:
                msg = {"content": f"Your Workflow has reached this Node at at {time} on {day}!"}
            
            response = requests.post(self.webhook_url, json=msg)

            if response.status_code == 204:
                pass
            else: 
                raise Exception("Could not send Message")

@PythonFZ
Copy link
Member Author

PythonFZ commented May 9, 2024

Maybe something like https://github.com/caronc/apprise

@PythonFZ PythonFZ transferred this issue from zincware/ZnTrack Feb 11, 2025
@PythonFZ
Copy link
Member Author

I think this fits much better for the graph executor than the Node, which is why I moved it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants