Please help - Notion, GPT and Pipedream

Please help - Notion, GPT and Pipedream

I need help with pipedream, GPT and notion.

See at the bottom to as to why I do not use notion AI

I am setting up a automation on pipedream so that it can write content on a page for me in notion using chat gpt. The workflow is as follows.

  1. Trigger: New page on a database
  2. Action1: When the trigger goes off, the chat GPT is prompted
  3. Action 2: The results of the gpt prompt is populated onto a page

For example: I create a database about cat breeds.

  1. Trigger: A new cat breed is entered onto the database
  2. Action 1: GPT is asked to write a summary of the cat breed
  3. Action 2: The results of the prompt is populated onto that same page

So I have everything roughly working but I have a problem with two things.

  1. I want the prompt to detect the name of the cat breed from the database and use it in the prompt.

For example: ‘Write the stats of ‘Name of the cat breed from step 1’ cat breed and write three positives and three negatives about owning it.’

The problem I am having is getting the prompt to detect the name of the cat breed from the trigger. When I look at the results of the trigger, I try to copy the path of the page or id… but it is just a series of numbers. Any advice? Treat me like a noob please (cos i am)

  1. I want it to update the actual page itself - but under update page in the pipedream action, there is no option to paste the path of the results from the gpt prompt. My work around currently is to create a page and send it to a new database - but I have the problem now of creating a title and matching it to the original cat breed name.

I hope someone can help or direct me to where to find the answer.

So even though I pay for Notion AI, for the last 2 days it has not been working well for me. I set up custom blocks and it just either gives me error 429 or 600. I thought maybe they set a limit for how many uses for a day, so I laid of it and it is still sporadic.

I mentioned above because I know I may be asked why am I using pipedream and my openAI key.

The problem I am having is getting the prompt to detect the name of the cat breed from the trigger. When I look at the results of the trigger, I try to copy the path of the page or id… but it is just a series of numbers. Any advice? Treat me like a noob please (cos i am)

@goldstartefl the trigger will not contain all your page information. To get your page content, you’ll need to add another action right below your trigger: Notion - Retrieve Block with an option Retrieve Block Children. Then select your page

This action should fetch all blocks in your page. Then you can select the cat bread from there

1 Like

Okay - I will give this a go and get back to you

Thank YOU!!!

It worked! What about point 2? How do I update the results of the prompt onto the page itself rather than creating a new page?

@goldstartefl

How do I update the results of the prompt onto the page itself rather than creating a new page?

Sorry I got lost in your texts, To update the results of the prompt onto the page, you can use the Notion action - Append Block to Parent, here’s an example:

1 Like

Literally I have no words to thank you. Worked perfectly.

1 Like

Hi - So I managed to work it out and created a workflow from start to end where when the trigger of a page being added to the database, then a number of requests are sent to chat gpt and the replies are added to that very page.

I did exactly what you said using the retrieve block and then append block. It worked wonderfully.

However - when I deploy it and a new entry to the notion database- I expect it to do all the steps on the new entry - but it doesn’t - it just adds to the original entry I did in the set up phase. Let me explain.

Workflow:
Trigger - Breed of cat added to database ‘Red cat’
Retrieve block - retrieves the breed name on the database - retrieves ‘Red cat’
Send request to Chat GPT: Please write down positives and negatives of owning named ‘Red cat’
Append block: Please add the gpt reply to database

So this was successful

Then I deployed it.

The problem is when I add a new breed to the database - for example I added a new row entitiled ‘Black cat’ - pipedream detects it but does a whole process again for ‘Red cat’ and adds it to the ‘Red cat’ page - instead of adding it to the new ‘black cat’ page.

I go back to edit the workflow - and I see that the block ID under the retrieve block section is still set on ‘red cat’ instead of changing to the new entry ‘black cat’ - the same for all the append block sections - the parent block ID is still on the ‘red cat’ and not on the ne entry ’ black cat’.

I check all is working and change the retrieve blocks and the append blocks - and the information is populated on the new page as I want. But then I go again to add a new entry - it does it again.

I hope it is clear.

So I basically need to tell the retrieve block and the append block to do carry out the work based on whatever NEW entry is added to the database rather than working on whatever block i inputed when testing the workflow

I worked it out in the end. All is working. Thanks!