Lesson 8 - Automate With Flows - Onboarding
Вставка
- Опубліковано 9 вер 2024
- Automation is the secret sauce to a smooth, efficient project. In this lesson, we'll explore how to automate tasks and processes within Directus using Flows. Say goodbye to manual work and hello to increased productivity! 🤖💼
BONUS: Want more automation inspiration? Watch this #I-Made-This episode ( • Building a Platform to... ) where Bryant, Pedro, and John discuss the actual flows powering Bryant’s training and community platform.
TODO:
1. Identify tasks and processes in your project that can be automated.
2. Set up Flows in Directus to automate these tasks.
3. Test your Flows to ensure they're working as expected.
4. Share your automation ideas in the group discussion for this lesson. Let's help each other save time and improve our workflow! 🧪🔧
PS: You can grab the script used in this lesson here (gist.github.co....
I want to access an environment variable on an operation but "{{ $env. }}" gives me null data. I already included the variable on the docker-compose.yml file and also included it on FLOWS_ENV_ALLOW_LIST. Is there something I'm doing wrong?
Testing out flows on a live database is a terrible way to debug code. This is a brilliant feature, but as it stands with it's non-existant documentation and live wire workflow, this is pretty much still in alpha phase.
How do your chain a variable from a previous operation that isn't an internal directus key like trigger? So if I had a Read Operation with the name "Get User Name" (key = get_user_name), does this mean that in subsequent operations, to chain to this value, I would use {{get_user_name.id}}, {{get_user_name.firstname}}, {{get_user_name.lastname}}? Or do I need to insert 'payload' between 'get_user_name' and 'id'?
You got it - you can refer to any data in the chain by the key it was returned from.
@@DirectusVideos awesome. Thank you.
Link to script is broken ;(
In run script i am using new Date(dateString) function but it is not working. Are these not supported?
Date is a standard built in JS object which means it should work in the Run Script operation
@@DirectusVideos that was my expectations too but it is not working. Basically I tried simple thing like new Date('2023-05-15'). But it is returning an empty object.
Are we going to have module syntax in "run script" action in the future?
Can you provide an example of what you mean? Are you talking about ES6 vs CommonJS?
@@DirectusVideos Yes I mean using ES6, export default ... instead of module.exports = ...
how to trigger a another flow
There's an operation which does just this :)
{
"name": "Error",
"message": "spawn /usr/sbin/sendmail ENOENT"
}
error in email payload
Sorry you've hit an error! Unfortunately, UA-cam is not a great platform for providing support or troubleshooting.
I'd recommend joining our Discord community (directus.chat) - where you can provide some additional context context and other super friendly community members could be able to help you sort this out.
How to join
joined discord